Once you retrieve a logger object from LogBox, you are ready to start sending messages. We already covered how to dynamically add/remove/list/check appenders from a logger, so let's look at the other methods we have available:
Every logger has access to the following public variables:
Property | Description |
| A reference to the |
Method | Description |
| Checks if this logger can log a certain type of severity. There is also a |
| Checks if this logger can log a certain type of severity. |
| Set the category name. |
| Get the root logger. |
| Get the minimum severity level. |
| Set the minimum severity level. |
| Get the maximum severity level. |
| Set the maximum severity level. |
Method | Description |
| Log a fatal message. |
| Log an error message. |
| Log a warning message. |
| Log an information message. |
| Log a debug message. |
| Log any kind of message. |
As you can probably tell, all logging methods take in a message string an a second argument called extraInfo
. This extraInfo
argument can be anything from a string, a structure, a query or whatever. This way you can send in a complex structure that the appenders will serialize into message form or log into the appropriate channel. Thus, extraInfo
can be very handy when you are building your own custom appenders.
// setting some messagesmyLogger = logBox.getLogger( this ); // "com.model.dao"​myLogger.info( "I just created my first logger" );​try{data = dao.getDBData();}catch( any e ){myLogger.error("Something really died on my dbdata method: #e.message# #e.detail#",e.tagContext);}
I hope that by now you understand the basics of loggers and how easy it is to use them.