V
vj
problem implementing log4j? not inserting data in new userlog.log other
then server.log
<!-- A time/date based rolling appender -->
<appender name="FILE"
class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File"
value="${jboss.server.home.dir}/log/server.log"/>
<param name="Append" value="false"/>
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<!-- Rollover at the top of each hour
<param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
-->
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n
-->
<param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
<!-- The full pattern: Date MS Priority [Category]
(Thread:NDC) Message\n
<param name="ConversionPattern" value="%d %-5r %-5p [%c]
(%t:%x) %m%n"/>
-->
</layout>
</appender>
<!-- A time/date based rolling appender -->
<appender name="USERLOGSFILE"
class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File"
value="${jboss.server.home.dir}/log/userlog.log"/>
<param name="Append" value="false"/>
<!-- Rollover at the top of each hour
<param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
-->
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n
-->
<param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
<!-- The full pattern: Date MS Priority [Category]
(Thread:NDC) Message\n
<param name="ConversionPattern" value="%d %-5r %-5p [%c]
(%t:%x) %m%n"/>
-->
</layout>
</appender>
<category name="UserActionsLogger">
<priority value="INFO" />
<appender-ref ref="USERLOGSFILE"/>
</category>
Why i am always getting error as
2006-12-04 14:10:32,483 INFO [STDOUT] log4j:ERROR Could not create an
Appender. Reported error follows.
2006-12-04 14:10:32,483 INFO [STDOUT] java.lang.ClassCastException:
org.jboss.logging.appender.DailyRollingFileAppender
I don't understand this problem is from Log4j.jar or any class not
getting initialized.
I can get some data displayed in server.log if i use
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Target" value="System.out"/>
<param name="Threshold" value="INFO"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n
-->
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p
[%c{1}] %m%n"/>
</layout>
</appender>
But i need to get data in seperate file say userlog.log where have to
fetch username with some more info is some standared format.
Please guide me where the propblem is coming from.
thanks
then server.log
<!-- A time/date based rolling appender -->
<appender name="FILE"
class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File"
value="${jboss.server.home.dir}/log/server.log"/>
<param name="Append" value="false"/>
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<!-- Rollover at the top of each hour
<param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
-->
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n
-->
<param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
<!-- The full pattern: Date MS Priority [Category]
(Thread:NDC) Message\n
<param name="ConversionPattern" value="%d %-5r %-5p [%c]
(%t:%x) %m%n"/>
-->
</layout>
</appender>
<!-- A time/date based rolling appender -->
<appender name="USERLOGSFILE"
class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File"
value="${jboss.server.home.dir}/log/userlog.log"/>
<param name="Append" value="false"/>
<!-- Rollover at the top of each hour
<param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
-->
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n
-->
<param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
<!-- The full pattern: Date MS Priority [Category]
(Thread:NDC) Message\n
<param name="ConversionPattern" value="%d %-5r %-5p [%c]
(%t:%x) %m%n"/>
-->
</layout>
</appender>
<category name="UserActionsLogger">
<priority value="INFO" />
<appender-ref ref="USERLOGSFILE"/>
</category>
Why i am always getting error as
2006-12-04 14:10:32,483 INFO [STDOUT] log4j:ERROR Could not create an
Appender. Reported error follows.
2006-12-04 14:10:32,483 INFO [STDOUT] java.lang.ClassCastException:
org.jboss.logging.appender.DailyRollingFileAppender
I don't understand this problem is from Log4j.jar or any class not
getting initialized.
I can get some data displayed in server.log if i use
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Target" value="System.out"/>
<param name="Threshold" value="INFO"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n
-->
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p
[%c{1}] %m%n"/>
</layout>
</appender>
But i need to get data in seperate file say userlog.log where have to
fetch username with some more info is some standared format.
Please guide me where the propblem is coming from.
thanks