Wiki source for Logging
======Logging======
Xmlsh uses the [[http://logging.apache.org/log4j Log4J]] subsystem for logging.
====Configuration====
On startup, xmlsh checks to see if Log4J has previously been initialized, and if so no action is taken.
If the environment variable **XLOG4JPATH ** is set then it is used as the path to a log4j configuration file.
If no XLOG4JPATH is not set or if the file cannot be parsed then the following is used to choose a file to log.
- if **XLOGFILE** is specified then it is used as the log file
- if the java user.home system property is set then xmlsh.log in that directory is used
- if the java user.dir system property is set then xmlsh.log in that directory is used
If a file is is found to log then a simple ""FileAppender"" is used for logging to that file.
If no file is found then the ""BasicConfigurator"" is used (which logs to stderr).
Filenames should be full paths because a relative path is often not what you expect.
Logging is done for every command executed, as well as stack traces for every exception.
You can explicitly add a log record using the [[CommandLog log Command]]
----
See Also [[CommandLog log command]]
See Also [[BuiltinVariables builtin variables]]
Xmlsh uses the [[http://logging.apache.org/log4j Log4J]] subsystem for logging.
====Configuration====
On startup, xmlsh checks to see if Log4J has previously been initialized, and if so no action is taken.
If the environment variable **XLOG4JPATH ** is set then it is used as the path to a log4j configuration file.
If no XLOG4JPATH is not set or if the file cannot be parsed then the following is used to choose a file to log.
- if **XLOGFILE** is specified then it is used as the log file
- if the java user.home system property is set then xmlsh.log in that directory is used
- if the java user.dir system property is set then xmlsh.log in that directory is used
If a file is is found to log then a simple ""FileAppender"" is used for logging to that file.
If no file is found then the ""BasicConfigurator"" is used (which logs to stderr).
Filenames should be full paths because a relative path is often not what you expect.
Logging is done for every command executed, as well as stack traces for every exception.
You can explicitly add a log record using the [[CommandLog log Command]]
----
See Also [[CommandLog log command]]
See Also [[BuiltinVariables builtin variables]]