You access logging on Forge with the --logLevel
option. Its usage is as follows:
--logLevel (
<topicName>
=)<logLevel>
By selecting a level you are requesting all feedback at of that level of severity and greater. For example, by specifying the WARN
level, you receive WARN
, ERROR
, and FATAL
messages.
The --logLevel
option sets either the default log level, the topic log level, or both:
The default log level provides global logging for the component:
forge --logLevel WARN
This example logs all
WARN
level or higher messages.Note
Forge defaults to log all
INFO
or higher level messages if a default level is not specified.The topic log level provides logging at the specified level for just the specified topic:
forge --logLevel baseline=DEBUG
This example overrides the default log level and logs all
DEBUG
messages and higher in the baseline topic.If two different log levels are specified, either globally or to the same topic, the finer-grained level is used:
forge –logLevel INFO –logLevel WARN
In the case of this example, all
INFO
level messages and higher are printed out.
It is possible to specify both default and topic level logging in the same command to filter the feedback that you receive. For example:
forge --logLevel WARN --logLevel config=INFO --logLevel update=DEBUG
This command works as follows:
The Forge
-v
logging option is still supported, but has been changed
to alias the
--logLevel
option as follows:
-v[f|e|w|i|d]
. The following table maps the relationships
and indicates the status of the arguments in this release (supported or
deprecated).
Argument |
Status in 11.0.0 |
Pre-6.x meaning |
11.0.0 log level |
---|---|---|---|
|
Supported |
Defaults to v (verbose) or the EDF_LOG_LEVEL environment variable. |
|
|
Deprecated |
Verbose (all messages). |
|
|
Supported |
Info (info, stat, warnings, and errors). |
|
|
Deprecated |
Stat (stat, warnings, and errors). |
|
|
Supported |
Warnings and errors. |
|
|
Supported |
Errors. |
|
|
Deprecated |
Quiet mode (errors). |
|
|
Deprecated |
Silent mode (fatal errors). |
|
|
Supported |
n/a |
|
|
Supported |
n/a |
|
|
Deprecated |
Printed out the timestamp when using
|
Has no effect. The timestamp is always printed now. |
In Forge, the
-o
flag defines a location for the logging output
file. If you do not specify a location, it logs to standard error.
The following snippet shows the start of an output file:
INFO 01/25/07 15:15:50.791 UTC FORGE {config}: forge <version> ("i86pc-win32") INFO 01/25/07 15:15:50.791 UTC FORGE {config}: Copyright 2001-2007 Endeca Technologies, Inc. INFO 01/25/07 15:15:50.791 UTC FORGE {config}: Command Line: i86pc-win32\bin\forge.exe INFO 01/25/07 15:15:50.791 UTC FORGE {config}: Initialized cURL, version: libcurl/7.37.0 OpenSSL/1.0.1i ERROR 01/25/07 15:15:50.791 UTC FORGE {config}: A file name is required!
The EDF_LOG_LEVEL
environment variable continues to be supported. If used, it should be set to one of the new log level names.
The EDF_LOG_LEVEL
environment variable sets the default Forge log level.
If you choose to use EDF_LOG_LEVEL
, the variable should be set to one of the new log level names, such as WARN
or ERROR
. Just as in previous versions of logging, the value set in EDF_LOG_LEVEL
may be overridden by any command line argument that changes the global log level.