Home arrow static arrow Java Programming [Archive] - Logging package help needed !!
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Logging package help needed !!
This topic has 1 reply on 1 page.

Posts:26
Registered: 11/27/03
Logging package help needed !!  
Aug 9, 2004 3:25 AM



 
Hi All,
I am trying to understand the logging API.
I have used the log4J as a logging framework and hence am trying to see whether the following features are possible or not with the java.util.logging (JUL) package.

1. Can i format the messages as can be done using the Log4J using pattern layout. There are patterns in Log4J which I think I am not able to find with the JUL.?

2. Can i assign specific handlers(in log4J terms- Appenders) to individual loggers.?

3. Can the configuration file (property file) specify properties pertaining to individual loggers.. I am finding the configuartion file a bit cumbersome with comparison to Log4J..

Now point 2, I know could be possible programatically as API's are exposed. .. but i was wondering if these are possible with the configuration file ..
Also would help a lot if I can get all the config properties the configuration file for JUL can have.. a master list somewhere !!!

Any help is genuinely appreciated..

Regards,
Vaibhav
 

Posts:6,750
Registered: 1/25/04
Re: Logging package help needed !!  
Aug 9, 2004 9:25 AM (reply 1 of 1)



 
1. Can i format the messages as can be done using the
Log4J using pattern layout. There are patterns in
Log4J which I think I am not able to find with the
JUL.?

I think so. "Logger.log

public void log(Level level,
String msg,
Object[] params)
Log a message, with an array of object arguments.

If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects.

Parameters:
level - One of the message level identifiers, e.g. SEVERE
msg - The string message (or a key in the message catalog)
params - array of parameters to the message"

2. Can i assign specific handlers(in log4J terms-
Appenders) to individual loggers.?

Yes.

3. Can the configuration file (property file) specify
properties pertaining to individual loggers.. I am
finding the configuartion file a bit cumbersome with
comparison to Log4J..

Yes, IIRC everything is configured by logger name.

Now point 2, I know could be possible programatically
as API's are exposed. .. but i was wondering if these
are possible with the configuration file ..

I'm not sure how much you can do with the config file, since I've never used it. However, if that doesn't suit you you can also make a config class instead.

Also would help a lot if I can get all the config
properties the configuration file for JUL can have.. a
master list somewhere !!!

Don't know.
 
This topic has 1 reply on 1 page.