[jboss-dev-forums] [JBoss AS 7 Development] - Re: Using Log4J in AS7

David Jensen do-not-reply at jboss.com
Thu Nov 15 13:34:48 EST 2012


David Jensen [https://community.jboss.org/people/davidj] created the discussion

"Re: Using Log4J in AS7"

To view the discussion, visit: https://community.jboss.org/message/776750#776750

--------------------------------------------------------------
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
[https://community.jboss.org/message/776750#776750]

Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20121115/fe86f01a/attachment.html 


More information about the jboss-dev-forums mailing list