This is an implementation of the Java Logging API's Handler class that will route log messages to the Agentry Server Java System Connection's log file.
All members of AgentryHandler, including inherited members.
VariablesModifier and Type | Variable | Description |
---|---|---|
protected Formatter | _defaultFormatter | This is the default formatter used by this handler. |
Modifier and Type | Constructor | Description |
---|---|---|
public | AgentryHandler() | Constructs a new AgentryHandler object. |
Modifier and Type | Method | Description |
---|---|---|
public void | close() | Agentry log files cannot be closed from Java; this method does nothing. |
public void | flush() | The Agentry server always flushes its log files; this method does not do anything explicit. |
protected LogLevel | mapLogLevel(Level) | Maps a Java log level to an Agentry log level, as described in the class documentation. |
public void | publish(LogRecord) | Publishes a log record to the Agentry server. |
It is also capable of routing messages to an Agentry user log file, if it receives objects of class UserLogRecord instead of objects of the base class LogRecord. UserLogRecord objects can be easily generated by using the UserLogger class.
Both the Java Logging API and the Agentry Server support the concept of log levels. The logging level of the Agentry Server is configured in the AgentryLogging.ini file, and the Agentry Server supports six levels, 0 through 5, with level 0 messages always being logged. For each system connection, there is a level setting in the configuration file, and all messages at or below that setting will be logged.
The levels in the Java Logging API map to the log levels in Agentry as follows:
Java Logging API | Agentry | Purpose |
---|---|---|
Level#SEVERE | Level 0 | Severe errors, always logged |
Level#WARNING | Level 1 | Warnings or recoverable errors |
Level#INFO | Level 2 | "Now doing this" type messages |
Level#CONFIG | Level 2 | Configuration settings and related messages. Note that this will map to the same Agentry level as Level.INFO messages. |
Level#FINE | Level 3 | Details of why a decision is being made. This is the level that the Server.debug and User.debug methods will log at. |
Level#FINER | Level 4 | Values being set from files, user input, etc; details of calculations. |
Level#FINEST | Level 5 | Really low level details. This is the level that the AJAPI classes and the Agentry Server will log at, so if you enable this you may get a lot of log messages. Because of this, using this level in end-user code is discouraged. |
Configuration: