Logging
Jinx redirects all stdout and stderr to a log file. This includes logging from the Jinx addin and from user code. All logging from Java is done using the standard logging package java.util.logging.
The [LOG] section of the config file determines where logging information is redirected to, and the verbosity of the information logged.
Jinx creates some configuration substitution variables that are useful when setting up logging.
Substitution Variable | Description |
pid | process id |
date | current date |
xl_version1 | Excel version |
jinx_version2 | Jinx version |
path
Path where the log file will be written to.
This may include substitution variables as listed above, e.g.
file
Filename of the log file.
This may include substitution variables as listed above, e.g.
format
The format string is used by the logging module to format any log messages. An example format string is:
The format string may include the following substitutions variables:
Format Variable | Description |
message | Log record message |
name | Name of logger |
asctime | Log record time in YYYY-mm-dd:HH:MM:SS,millis format |
filename | Filename of the source file that generated the log record |
lineno | Line number where the log record was created |
method | Method name that created the log record |
level | Logging level |
levelno | Logging level as a number |
process | Process id of the process that created the log record |
processName | Name of process that created the log record |
thread | Thread id that created the log record |
level
The log level can be used to filter out or show warning and errors. It sets the log level for the root java.util.logging.Logger, as well as setting Jinx’s internal log level.
It may be set to any of the following
- severe
- warning
- info
- config
- fine
- finer
- finest
If you are having any problems with Jinx it’s recommended to set the log verbosity to finest as that will give a lot more information about what Jinx is doing.
max_size3
Maximum size the log file is allowed to grow to.
Once the log file goes over this size it will be renamed to add a timestamp to the file and a new log file will be started.
The size can be in Kb, Mb or Gb, for example to set
it to 100Mb use max_size = 100Mb
.
If zero, the log file will be allowed to grow indefinitely.
roll_interval3
If set the log file will be rolled periodically.
This setting can be used alongside max_size
and if both are set the log
will be rolled either either the roll period is reached or the file size goes
over the maximum allowed size.
The interval can be any of:
-
a number of days, hours, minutes or seconds using the form
Nd
for days (eg7d
),Nm
, andNs
respectively. -
midnight
to indicate the log should be rolled after midnight. -
W0-6
to roll on a specific day of the week, egW0
for Sunday andW6
for Saturday.
backup_count3
The number of backup log files to keep after rolling the log.
If set, only the last N rolled log files will be kept.
Instead of setting a fixed number a period can be specified,
eg 7d
to keep log files for 7 days.
encoding3
Encoding to use when writing the log file.
Defaults to utf-8
.