| Integration |
|
To achieve compatibility with any and all logging frameworks, I've taken the coward's way out -- Logahawk
does not natively interact with any logging framework (except Java Logging API because its part of
the standard Java libraries). I apologize up front about making you implement the last yard, but given how
easy it is I hope you can forgive me.
|
| Determine Logging Framework |
|
The first step to do is to determine (or decide) which logging framework you use. Which framework
depends personal preference or the type of application you are writing.
|
| Popular logging frameworks |
|
|
| Create Logger |
|
The next step is to create a Logger. The most basic but
complete Logger implementation is the SimpleLogger.
You can also implement your own Logger implementation to suit your needs.
If you wish to find Loggers statically (which some frameworks require), you can create your Loggers and
register them with a LoggerRegistry. (Currently all
setup must be done manually, there is no configuration file like many frameworks provide.)
|
| Add Listeners |
|
The most important step is to add one or more Listener to the
Logger you just created. The SimpleLogger provides methods
to add Listeners.
|
| Add Formatters |
|
Almost (but not quite) as important as adding Listeners is adding
Formatters. Without formatters Logahawk will produce some
ugly (and sometimes useless) log messages.
The Util library class can be used to add all of the formatters
that come with Logahawk. You should also look at building some formatters which are specific to your
domain problem.
The SimpleLogger provides methods to add Formatters.
|
| Finished |
|
You're all done! Start logging!
|