JBoss Community

Re: Using Log4J in AS7

created by David Jensen in JBoss AS 7 Development - View the full discussion

Hi,

 

Can someone step me thru how to setup log4j on JBoss AS7?

I've tried the following.

 

I have an EJB Jar file which has a "log4j.properties" file.

 

This same JAR file will log correctly on other AppServers (such as Glassfish).

 

I read else where that I must do the following in my "standalone.xml" file:

<size-rotating-file-handler name="MY_LOGGER">

    <level name="TRACE"/>

    <formatter>

        <pattern-formatter pattern="%d{MMM-dd hh:mm:ss} [%c{1}] %m%n"/>

    </formatter>

    <file relative-to="jboss.server.log.dir" path="myLogger.log"/>

    <rotate-size value="9216K"/>

    <max-backup-index value="3"/>

</size-rotating-file-handler>


<logger category="com.mycompany">

    <level name="TRACE"/>

    <handlers>

        <handler name="MY_LOGGER"/>

    </handlers>

</logger>

 

I tried that and it still doesn't work

 

I don't want to do anything fancy. All I want is for my log statements to be written in a file called "myLogger.log".

 

Any help would be appreciated.

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community