The log command group consists of a single command, show, that interacts directly with the log-reader service to get and display available log entries.
The group contains the following command:
This command group works with any OSGi compliant log-service implementation.
The show command is used to show selected log entries that are available from the log service, i.e., held in memory.
Entries will be ordered with the most recent entry first. If no bundle argument is supplied, log entries from all bundles are considered.
show [-help] [-f] [-h #hours#] [-l #level#] [-n #count#] [-s] [<bundle>] ...
Parameters:
Show log error entries.
log> show -l error 07/06 15:16:41 ERROR #19, messenger - Failed to load configuration / java.io.FileNotFoundException: /demo/gatespace/bin/host.conf (No such file or directory) 07/06 15:16:41 ERROR FRAMEWORK - FrameworkError: org.osgi.framework.BundleException: Bundle.start: BundleActivator start failed 07/06 15:16:41 ERROR #18, authentication - Failed to read KeyStore / java.net.MalformedURLException: null: java.lang.NullPointerException:
The logconfig command group offers commands for configuring a log service implementation.
This command group only works with log service implementations that publishes a org.knopflerfish.service.log.LogConfig.
The group contains the following commands:
The memory command is used to control the number of log entries that are held in memory.
If the command is given without any parameters the current maximum number of log entries is shown.
Show and set the number of log entries in memory.
memory [-help] [<int>]Parameters:
The setlevel command is used to control what log entries are actually written to the log. There is one default log level and in addition each bundle can have its own setting. A log level may also be set giving a bundle short name in which case all bundles with this name will be logged at the given level. The default level is used for bundles without log levels of their own.
Entries with a severity level higher or the same as the current default level will be logged. For example, with the default level set to warning, entries with level warning or error will be logged.
The severity order of the levels is:
Set log level.
setlevel [-help] <level> [<bundle>] ...Parameters:
The showlevel command lists the default log level and the levels for the specified bundles, or for all bundles if no bundle is specified (only bundles with a level different from the default level are listed).
The output has columns for bundle id, log level and bundle name. A "*" in the id column indicates the default level, and a "-" in the same column indicates that the log level was set with a bundle short name or that the bundle is not yet installed. The bundle name column may contain a bundle short name or if the log level of a bundle not yet installed is set the bundle location will be displayed instead.
Show current log levels.
showlevel [-help] [<bundle>] ...Parameters:
logconfig> setlevel warning console logconfig> showlevel * debug (default) 2 Warning console - Warning console (default)
Enables printout of all log entries on standard out. The entries are written to the log as well.
The out command is disabled if no valid configuration has been received, that is, the Configuration Management(CM) component has not generated a configuration or the CM component is not available. See [1] for further description of the configuration procedure.
If the command is given without parameters the present setting is shown.
out [-help] [-on | -off]Parameters:
This command controls the writing of log entries to file, the size of log files, how many generations of log files to keep and whether each log entry should be flushed to file.
The file command is disabled if no valid configuration has been received, that is, the Configuration Management(CM) component has not generated a configuration or the CM component is not available. See [1] for further description of the configuration procedure.
If the command is given without parameters the present setting is shown.
Note that a change in log file size does not take effect until the present log file has been filled and a new is started.
Configures the writing of log entries to file.
file [-help] [-on | -off [-size #size#] [-gen #gen#] [-flush | -noflush]Parameters:
Turn on writing to standard out
logconfig> out -on
Turn on flushing of buffers after each log entry.
logconfig> file -flush