diff --git a/README.md b/README.md
index 6539783ec9..0e00ea798b 100644
--- a/README.md
+++ b/README.md
@@ -302,7 +302,7 @@ for all logged messages. An example is shown below:
2021-04-15:06:22:59 [MultiTypeSymbolTable] addEntry Line 127 DEBUG [Chapel] adding symbol: id_4
```
-### Logging Levels
+### Log Levels
Available logging levels are ERROR, CRITICAL, WARN, INFO, and DEBUG. The default logging level is INFO where all messages at the ERROR, CRITICAL, WARN, and INFO levels are printed. The log level can be set globally by passing in the --logLevel parameter upon arkouda\_server startup. For example, passing the --logLevel=LogLevel.DEBUG parameter as shown below sets the global log level to DEBUG:
@@ -318,14 +318,24 @@ In addition to setting the global logging level, the logging level for individua
In this example, the logging level for all other Arkouda modules will be set to the global value WARN.
-### Logging Channels
+### Log Channels
-Arkouda logs can be written either to the console (default) or to the arkouda.log file located in the Arkouda deployment directory. To enable log output to the arkouda.log file, start Arkouda as follows with the --logChannel flag:
+Arkouda logs can be written either to the console (default) or to the arkouda.log file located in the .arkouda directory. To enable log output to the arkouda.log file, start Arkouda as follows with the --logChannel flag:
```
./arkouda_server --logChannel=LogChannel.FILE
```
+### Arkouda Command Logging
+
+All incoming Arkouda server commands submitted by the Arkouda client can be logged to the commands.log file located in the .arkouda directory. Arkouda command logging is enabled as follows:
+
+```
+./arkouda_server --logCommands=true
+```
+
+The Arkouda command logging capability has a variety of uses, one of which is replaying analytic or data processing scenarios in either interactive or batch mode. Moreover, a sequence of Arkouda server commands provides the possibility of utilizing Arkouda clients developed in other languages such as Rust or Go. In still another use case, command logging in Arkouda provides a command sequence for starting Arkouda via cron job and processing large amounts of data into Arkouda arrays or dataframes, thereby obviating the need for a user to wait for well-known data processing/analysis steps to complete; this use case is of particular value in situations where the data loading process is particularly time-intensive. Finally, command logging provides a means of integrating a non-interactive Arkouda data processing/analysis sequence into a data science workflow implemented in a framework such as Argo Workflows or Kubeflow.
+
## Type Checking in Arkouda toc
@@ -379,6 +389,7 @@ Beginning after tag `v2019.12.10` versioning is now performed using [Versioneer]
which determines the version based on the location in `git`.
An example using a hypothetical tag `1.2.3.4`
+
```bash
git checkout 1.2.3.4
python -m arkouda |tail -n 2
diff --git a/src/Logging.chpl b/src/Logging.chpl
index a222db46f0..e98c604620 100644
--- a/src/Logging.chpl
+++ b/src/Logging.chpl
@@ -82,7 +82,7 @@ module Logging {
if channel == LogChannel.CONSOLE {
return new owned ConsoleOutputHandler();
} else {
- return new owned FileOutputHandler("%s/arkouda.log".doFormat(here.cwd()));
+ return new owned FileOutputHandler("%s/.arkouda/arkouda.log".doFormat(here.cwd()));
}
}
diff --git a/src/ServerConfig.chpl b/src/ServerConfig.chpl
index 873f4cc92c..ec67d15b38 100644
--- a/src/ServerConfig.chpl
+++ b/src/ServerConfig.chpl
@@ -51,6 +51,11 @@ module ServerConfig
Global log channel flag that defaults to LogChannel.CONSOLE
*/
config var logChannel = LogChannel.CONSOLE;
+
+ /*
+ Indicates whether arkouda_server commands should be logged.
+ */
+ config var logCommands = false;
/*
Port for zeromq
@@ -138,6 +143,7 @@ module ServerConfig
private config const lLevel = ServerConfig.logLevel;
private config const lChannel = ServerConfig.logChannel;
+
const scLogger = new Logger(lLevel,lChannel);
proc createConfig() {
diff --git a/src/ServerDaemon.chpl b/src/ServerDaemon.chpl
index c51f90d93f..5bb6703b66 100644
--- a/src/ServerDaemon.chpl
+++ b/src/ServerDaemon.chpl
@@ -608,6 +608,13 @@ module ServerDaemon {
break;
}
+ /*
+ * If logCommands is true, log incoming request to the .arkouda/commands.log file
+ */
+ if logCommands {
+ appendFile(filePath="%s/commands.log".doFormat(this.arkDirectory), formatJson(msg));
+ }
+
/*
* For messages that return a string repTuple is filled. For binary
* messages the message is sent directly to minimize copies.
@@ -763,7 +770,7 @@ module ServerDaemon {
var format = msg.format;
var args = msg.args;
var size = msg.size: int;
-
+
var msgArgs: owned MessageArgs;
if size > 0 {
msgArgs = parseMessageArgs(args, size);