Really dumb logging question...

View: New views
3 Messages — Rating Filter:   Alert me  

Really dumb logging question...

by Mark Dzmura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Guys:

Seems like default logging in Trails apps is somehow hard-coded at "INFO".

I have changed the log4j.properties in a trails webapp (src/main/resource/log4j.properties) to debug, warn, etc.., then rebuilt and redeployed ... but the logging level remains fixed at INFO.
I've verified that the log4j.properties that ends up in my .war file has the "log4j.rootLogger=" value that I want, but I always see log messages up through INFO level, and never DEBUG.

What am I missing?

Thanks,
Mark


Re: Really dumb logging question...

by Kalle Korhonen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 10/24/07, Mark Dzmura <mark.dzmura@...> wrote:
Guys:
Seems like default logging in Trails apps is somehow hard-coded at "INFO".

No, it's certainly not. I can change logging levels however I like.

I have changed the log4j.properties in a trails webapp (src/main/resource/log4j.properties) to debug, warn, etc.., then rebuilt and redeployed ... but the logging level remains fixed at INFO.
I've verified that the log4j.properties that ends up in my .war file has the "log4j.rootLogger=" value that I want, but I always see log messages up through INFO level, and never DEBUG.
What am I missing?

You most likely *don't* want to set the rootLogger level to anything below INFO. What usually happens is that the logging from all components, such as the container, fills out the logs with meaningless messages. What you probably want is to configure your app, maybe trails categories to DEBUG, for example: log4j.category.org.trails=debug. Typically, why this doesn't work is a) either your log4j.properties is not properly deployed, or is overwritten by another log4j.properties file in your target dir - check your /classes/ root, or b), your have another log4j.properties file in some common classpath that is visible to your application - e.g. straight up classpath, or, for example in Tomcat, shared/classes and common/classes.

What's your setup - you mentioned you are doing a rebuild & redeploy cycle?

Kalle

Re: Really dumb logging question...

by PabloS :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Also check the threshold on the appender you are using, because it won't ouput log messages above its threshold level (i.e. if the appender's threshold is INFO, it won't output any DEBUG messages).

Hope it helps.
Regards,
Pablo.

On 24/10/2007, Kalle Korhonen <kalle.o.korhonen@...> wrote:
On 10/24/07, Mark Dzmura <mark.dzmura@...> wrote:
Guys:
Seems like default logging in Trails apps is somehow hard-coded at "INFO".

No, it's certainly not. I can change logging levels however I like.

I have changed the log4j.properties in a trails webapp (src/main/resource/log4j.properties) to debug, warn, etc.., then rebuilt and redeployed ... but the logging level remains fixed at INFO.
I've verified that the log4j.properties that ends up in my .war file has the "log4j.rootLogger=" value that I want, but I always see log messages up through INFO level, and never DEBUG.
What am I missing?

You most likely *don't* want to set the rootLogger level to anything below INFO. What usually happens is that the logging from all components, such as the container, fills out the logs with meaningless messages. What you probably want is to configure your app, maybe trails categories to DEBUG, for example: log4j.category.org.trails=debug. Typically, why this doesn't work is a) either your log4j.properties is not properly deployed, or is overwritten by another log4j.properties file in your target dir - check your /classes/ root, or b), your have another log4j.properties file in some common classpath that is visible to your application - e.g. straight up classpath, or, for example in Tomcat, shared/classes and common/classes.

What's your setup - you mentioned you are doing a rebuild & redeploy cycle?

Kalle