aspose file tools
The moose likes Other Open Source Projects and the fly likes Using Log4j  in Simple Java programs Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "Using Log4j  in Simple Java programs" Watch "Using Log4j  in Simple Java programs" New topic
Author

Using Log4j in Simple Java programs

Sri Ram
Ranch Hand

Joined: Sep 08, 2002
Posts: 48
Hello,


I am new to log4j. I created a log4j.properties and kept it under my WEB-INF/classes folder of my web app and also I have initialized the log4j configuration during the application startup using one of my servlet.

I am able to get the Logger inside different java programs which are called by my servlet but my problem is I do have a web service which will be called from clients out side and they will invoke one of my Java Client program..( This is not going thru a servlet) my problem is when my simple java client is invoked, it reads the log4j.properties and initializes the configuration..I don't want that to happen .. is there any way to overcome this issue?

Please shed some light.

Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 32769
log4j can be configured in terms of packages. You could move the classes you want to use log4j in a different package than the ones you don't want to use it.


Android appsImageJ pluginsJava web charts
 
 
subject: Using Log4j in Simple Java programs
 
Threads others viewed
Logger(log4j) in Servlet
Problem with Setting up Jakarta Logging with AXIS
where to put log4j.properties?
log4j.properties: FileNotFoundException
remove log4j appender from an API
IntelliJ Java IDE