Hi Illka,
how about extending PoorMansLoggerImpl with a StringBuffer based logger
(all logs are buffered in a StringBuffer). While OJB boot process the
LoggerFactoryImpl use the new StringBufferLogger. On the first
#getLogger(...) call OJB checks for logging environment:
1. When logging environment is found initialize logger, get message
string from StringBufferLogger and log it as normal info message in logger.
2. Logging environment is missing or fails on initialization, then use
PoorMansLogger as logger and log StringBufferLogger message string as error.
Would this comply with the requirements you need?
regards,
Armin
Ilkka Priha wrote:
Hi
The recent boot logger patch changed default boot log level from WARN to
INFO invoking three new log messages during OJB startup:
[BOOT] INFO: Found logging properties file:
etc/config/tammi/root/ojb-logging.properties
[BOOT] INFO: Logging: Found logger class
'org.norther.tammi.root.ojb.OJBLogger
[BOOT] INFO: Loading OJB's properties:
jar:file:/home/imp/tammi-ttke-1.0.3/lib/tammi-ttke-1.0.3.jar!/etc/config/tammi/root/ojb.properties
The default boot logger implementation logs to System.out, which is not
desirable as applications running in background or not allowing console
messages can even crash. Typically, OJB is embedded to some other system
having its logging scheme already running when starting up OJB and
customizing OJB-logging.properties to integrate OJB log messages to this
scheme. Now OJB boot logger must be configured separately to disable
System.out messages and the only way to do it is through a
System.property, which requires a specific permission when
SecurityManager is used.
How about discarding the boot logger and to first load logging
properties, then create the corresponding logger and afterwards log the
above messages through that logger. Only if logging configuration is
missing or faulty, OJB could apply the System.out logger.
Regards,
Ilkka
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]