GeeCON Prague 2014*
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: 229
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: 10146
    
165



That doesn't look right. Try:



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

Joined: Sep 30, 2007
Posts: 229
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: 10146
    
165

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: 229
my log4j.properties
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10146
    
165

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: 229

Thank you Jaikiran. It is working fine now.
 
GeeCON Prague 2014
 
subject: Jboss can not recognize custom log4j.properties file