File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes Jboss can not recognize custom log4j.properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Jboss can not recognize custom log4j.properties file" Watch "Jboss can not recognize custom log4j.properties file" New topic
Author

Jboss can not recognize custom log4j.properties file

Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 234
Hi all,

I want my Jboss 4.2 to use a custom log4j.properties file.
For that I have changed the jboss-service.xml file as below:



But at the time of deploying Jboss can not find the file specified(FileNotFoundException).
How can I configure it so that it can find the log4j.properties file anywhere(outside jboss) else?
I am observing only .xml file is being recognized by jboss in above code. If that is the case then how could I make log4j.properties file being recognized by Jboss without keeping it in .ear.

Also I have placed the below code in log4j.properties to generate log file . Is that ok?


Thanks in Advance,
Kousik
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10289
    
168



That doesn't look right. Try:



[My Blog] [JavaRanch Journal]
Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 234
Hello,
Now my Jboss configuring after putting the line.


But is does nothing after that. Jboss just stops after configuring log4j.


Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10289
    
168

What does your log4j.properties look like? Maybe you have set logging levels to a very high level.
Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 234
my log4j.properties
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10289
    
168

log4j.rootLogger=ERROR, console, logfile


Your root logger level is set to ERROR, which means that anything below ERROR level will not be logged, unless you specifically configure individual loggers (like you have done for org.hibernate)

Usually, the root logger is set to INFO levels.
Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 234

Thank you Jaikiran. It is working fine now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jboss can not recognize custom log4j.properties file