aspose file tools*
The moose likes Other Open Source Projects and the fly likes Dynamic default log levels for each environment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Dynamic default log levels for each environment" Watch "Dynamic default log levels for each environment" New topic
Author

Dynamic default log levels for each environment

Kiran Kumar
Ranch Hand

Joined: Jan 06, 2003
Posts: 91
Hello All,

It's a very common practice to have a different default logging level for different environments in your landscape, like DEBUG for Dev server, INFO for test and WARN for Production.

How can this be done? I don't want to edit the configuration file before deploying on to production server.

Thank you for your time,
Kiran


------------<br />SCJP
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

I don't really agree. The more similar your test environment is to your production environment, the fewer problems you will miss before deploying. So I think your development logging levels should be the same as your production logging levels, except when you are actively debugging something. Which should not be a frequent occurrence.
Kiran Kumar
Ranch Hand

Joined: Jan 06, 2003
Posts: 91
Paul,

We have a "production-like" environment too. In any case, I would like to know how this configuration change across the landscape maintained.

Thanks,
Kiran
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

If you want something to be different in two deployments of an application, and you don't want to make last-minute edits before deploying to achieve that, then it follows that the difference must be configured outside the application. How you achieve that depends on where you are deploying your application.

(I suppose I don't have much sympathy for your logging example because we use logging as part of our business rules. For example we might write an entry to the log file when we got the orders from customer ABCD. Then when we have a hypothetical dispute with customer ABCD, we can see when the orders came in and whether they were consistently late, or something like that. We rarely use logging as a debugging or development tool. But that doesn't do anything to answer your question.)
Kiran Kumar
Ranch Hand

Joined: Jan 06, 2003
Posts: 91
I wonder if there any tools to do that..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic default log levels for each environment