Discussion:
RollingFileAppender
Jason Roscoe
2005-03-15 20:21:55 UTC
Permalink
I am brand spanking new to log4j. I have the following configuration file:



# Set root category priority to DEBUG and set its only appender to Console

log4j.rootCategory=DEBUG, Console, R



# Console is set to be a ConsoleAppender (writes to system console).

log4j.appender.Console=org.apache.log4j.ConsoleAppender



# R is set to be a RollingFileAppender (writes to file).

log4j.appender.R=org.apache.log4j.rolling.RollingFileAppender

log4j.appender.R.File=bouncebacks.log

log4j.appender.R.MaxFileSize=100KB



# Keep one backup file

log4j.appender.R.MaxBackupIndex=1



# R uses PatternLayout.

log4j.appender.R.layout=org.apache.log4j.PatternLayout

log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n



# Console uses PatternLayout.

log4j.appender.Console.layout=org.apache.log4j.PatternLayout

log4j.appender.Console.layout.ConversionPattern=[%5p]: (%C{1}.%M:%L) - %m%n



# dynamic log reader "Chainsaw"

# connects to chainsaw reader which must be running separately

# ex) java -classpath [path]/log4j.jar org.apache.log4j.chainsaw.Main

log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender

log4j.appender.Chainsaw.remoteHost=localhost

log4j.appender.Chainsaw.port=4445

log4j.appender.Chainsaw.locationInfo=true



When I run my application, I get these errors:



[ERROR]: (ConfiguratorBase.detachListAppender:96) - No output stream or file
set for the appender named [R].

[ WARN]: (PropertySetter.setProperty:173) - No such property [maxFileSize]
in org.apache.log4j.rolling.RollingFileAppender.

[ WARN]: (PropertySetter.setProperty:173) - No such property
[maxBackupIndex] in org.apache.log4j.rolling.RollingFileAppender.

[ WARN]: (RollingFileAppender.activateOptions:86) - Please set a
TriggeringPolicy for the RollingFileAppender named 'R'



Can someone help me get this to write to a file?



Thanks!!



Disclaimer: This e-mail message is intended only for the personal use of
the recipient(s) named above. If you are not an intended recipient, you
may not review, copy or distribute this message. If you have received this
communication in error, please notify us immediately by e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or distributed
without this statement.
Curt Arnold
2005-03-15 20:56:52 UTC
Permalink
Post by Jason Roscoe
I am brand spanking new to log4j. I have the following configuration
# Set root category priority to DEBUG and set its only appender to
Console
log4j.rootCategory=DEBUG, Console, R
# Console is set to be a ConsoleAppender (writes to system console).
log4j.appender.Console=org.apache.log4j.ConsoleAppender
# R is set to be a RollingFileAppender (writes to file).
log4j.appender.R=org.apache.log4j.rolling.RollingFileAppender
log4j.appender.R.File=bouncebacks.log
log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1
# R uses PatternLayout.
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
# Console uses PatternLayout.
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=[%5p]: (%C{1}.%M:%L) -
%m%n
# dynamic log reader "Chainsaw"
# connects to chainsaw reader which must be running separately
# ex) java -classpath [path]/log4j.jar org.apache.log4j.chainsaw.Main
log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender
log4j.appender.Chainsaw.remoteHost=localhost
log4j.appender.Chainsaw.port=4445
log4j.appender.Chainsaw.locationInfo=true
[ERROR]: (ConfiguratorBase.detachListAppender:96) - No output stream
or file
set for the appender named [R].
[ WARN]: (PropertySetter.setProperty:173) - No such property
[maxFileSize]
in org.apache.log4j.rolling.RollingFileAppender.
[ WARN]: (PropertySetter.setProperty:173) - No such property
[maxBackupIndex] in org.apache.log4j.rolling.RollingFileAppender.
[ WARN]: (RollingFileAppender.activateOptions:86) - Please set a
TriggeringPolicy for the RollingFileAppender named 'R'
Can someone help me get this to write to a file?
log4j 1.3 introduced a replacement
(org.apache.log4j.rolling.RollingFileAppender) for the previous
RollingFileAppender (org.apache.log4j.RollingFileAppender, notice the
missing .rolling). Your configuration is attempting to configure the
new RollingFileAppender with the properties for the old RFA.

In the last week, I added to the CVS an emulation of the old RFA that
delegates to the new RFA so that existing configuration files will
still work.

Depending on your circumstances, you could:

configure the new RFA and have a configuration file that only works
with 1.3 or later.
configure the old RFA and have a configuration file that works with 1.2
and the CVS HEAD, but no released version of 1.3.
Jason Roscoe
2005-03-15 20:58:26 UTC
Permalink
We are using log4j 1.3 Alpha 3, so what all will I need to do?

-----Original Message-----
From: Curt Arnold [mailto:***@apache.org]
Sent: Tuesday, March 15, 2005 3:57 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Post by Jason Roscoe
I am brand spanking new to log4j. I have the following configuration
# Set root category priority to DEBUG and set its only appender to
Console
log4j.rootCategory=DEBUG, Console, R
# Console is set to be a ConsoleAppender (writes to system console).
log4j.appender.Console=org.apache.log4j.ConsoleAppender
# R is set to be a RollingFileAppender (writes to file).
log4j.appender.R=org.apache.log4j.rolling.RollingFileAppender
log4j.appender.R.File=bouncebacks.log
log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1
# R uses PatternLayout.
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
# Console uses PatternLayout.
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=[%5p]: (%C{1}.%M:%L) -
%m%n
# dynamic log reader "Chainsaw"
# connects to chainsaw reader which must be running separately
# ex) java -classpath [path]/log4j.jar org.apache.log4j.chainsaw.Main
log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender
log4j.appender.Chainsaw.remoteHost=localhost
log4j.appender.Chainsaw.port=4445
log4j.appender.Chainsaw.locationInfo=true
[ERROR]: (ConfiguratorBase.detachListAppender:96) - No output stream
or file
set for the appender named [R].
[ WARN]: (PropertySetter.setProperty:173) - No such property
[maxFileSize]
in org.apache.log4j.rolling.RollingFileAppender.
[ WARN]: (PropertySetter.setProperty:173) - No such property
[maxBackupIndex] in org.apache.log4j.rolling.RollingFileAppender.
[ WARN]: (RollingFileAppender.activateOptions:86) - Please set a
TriggeringPolicy for the RollingFileAppender named 'R'
Can someone help me get this to write to a file?
log4j 1.3 introduced a replacement
(org.apache.log4j.rolling.RollingFileAppender) for the previous
RollingFileAppender (org.apache.log4j.RollingFileAppender, notice the
missing .rolling). Your configuration is attempting to configure the
new RollingFileAppender with the properties for the old RFA.

In the last week, I added to the CVS an emulation of the old RFA that
delegates to the new RFA so that existing configuration files will
still work.

Depending on your circumstances, you could:

configure the new RFA and have a configuration file that only works
with 1.3 or later.
configure the old RFA and have a configuration file that works with 1.2
and the CVS HEAD, but no released version of 1.3.



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-***@logging.apache.org
For additional commands, e-mail: log4j-user-***@logging.apache.org




Disclaimer: This e-mail message is intended only for the personal use of
the recipient(s) named above. If you are not an intended recipient, you
may not review, copy or distribute this message. If you have received this
communication in error, please notify us immediately by e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or distributed
without this statement.
Curt Arnold
2005-03-15 21:26:08 UTC
Permalink
Post by Jason Roscoe
We are using log4j 1.3 Alpha 3, so what all will I need to do?
I was hoping the analysis would get you off and running by yourself.

You have to choose an option:

Upgrade the the CVS HEAD and remove the ".rolling" from the classname.
Configure the new, more generic, log4j 1.3 RFA.

Unfortunately, I could not find an appropriate sample for the latter in
the test input files and wanted to avoid trying to mock up something
freehand. I don't believe the new RFA can be configured using an
properties file, since you have to configure nested objects, a
TriggeringPolicy (to determine when to change files) and RollingPolicy
(to determine what the file names are).


Something like:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration>

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j'>

<appender name="R"
class="org.apache.log4j.rolling.RollingFileAppender">
<rollingPolicy
class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
<param name="minIndex" value="1"/>
<param name="maxIndex" value="1"/>
<param name="activeFileName" value="bouncebacks.log"/>
<param name="fileNamePattern" value="bouncebacks.log.%i"/>
</rollingPolicy>

<triggeringPolicy
class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
<param name="maxFileSize" value="100KB"/>
</triggeringPolicy>

</appender>
....

</log4j:configuration>
Jason Roscoe
2005-03-16 14:12:58 UTC
Permalink
I tried using 1.2.9 (stable) and I was able to get the RollingFileAppend to
work. When I try running my application from a command line, I get this
error:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/log4j/Category

Here is my full config file:

# Set root category priority to DEBUG and set its only appender to Console
log4j.rootCategory=DEBUG, Console, R

# Console is set to be a ConsoleAppender (writes to system console).
log4j.appender.Console=org.apache.log4j.ConsoleAppender

# R is set to be a RollingFileAppender (writes to file).
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=bouncebacks.log
log4j.appender.R.MaxFileSize=100KB

# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

# R uses PatternLayout.
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

# Console uses PatternLayout.
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=[%5p]: (%C{1}.%M:%L) - %m%n

# dynamic log reader "Chainsaw"
# connects to chainsaw reader which must be running separately
# ex) java -classpath [path]/log4j.jar org.apache.log4j.chainsaw.Main
log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender
log4j.appender.Chainsaw.remoteHost=localhost
log4j.appender.Chainsaw.port=4445
log4j.appender.Chainsaw.locationInfo=true

-----Original Message-----
From: Curt Arnold [mailto:***@apache.org]
Sent: Tuesday, March 15, 2005 4:26 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Post by Jason Roscoe
We are using log4j 1.3 Alpha 3, so what all will I need to do?
I was hoping the analysis would get you off and running by yourself.

You have to choose an option:

Upgrade the the CVS HEAD and remove the ".rolling" from the classname.
Configure the new, more generic, log4j 1.3 RFA.

Unfortunately, I could not find an appropriate sample for the latter in
the test input files and wanted to avoid trying to mock up something
freehand. I don't believe the new RFA can be configured using an
properties file, since you have to configure nested objects, a
TriggeringPolicy (to determine when to change files) and RollingPolicy
(to determine what the file names are).


Something like:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration>

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j'>

<appender name="R"
class="org.apache.log4j.rolling.RollingFileAppender">
<rollingPolicy
class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
<param name="minIndex" value="1"/>
<param name="maxIndex" value="1"/>
<param name="activeFileName" value="bouncebacks.log"/>
<param name="fileNamePattern" value="bouncebacks.log.%i"/>
</rollingPolicy>

<triggeringPolicy
class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
<param name="maxFileSize" value="100KB"/>
</triggeringPolicy>

</appender>
....

</log4j:configuration>


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-***@logging.apache.org
For additional commands, e-mail: log4j-user-***@logging.apache.org





Disclaimer: This e-mail message is intended only for the personal use of
the recipient(s) named above. If you are not an intended recipient, you
may not review, copy or distribute this message. If you have received this
communication in error, please notify us immediately by e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or distributed
without this statement.
Curt Arnold
2005-03-16 17:34:14 UTC
Permalink
Post by Jason Roscoe
I tried using 1.2.9 (stable) and I was able to get the
RollingFileAppend to
work. When I try running my application from a command line, I get
this
org/apache/log4j/Category
This looks like a classpath issue, not a configuration issue.
org.apache.log4j.Category was the original name for Logger and is still
in the jar to support older applications but is deprecated. So it is
likely that you have a class that uses Category, but your classpath is
not set up to find the log4j jar.

You can confirm that o.a.l.Category is in your jar file by:

jar -tf log4j-1.2.9.jar | grep Category.class

You can check if it is on your classpath by

java [classpath stuff] org.apache.log4j.Category

if you get a NoClassDefFoundError, then log4j isn't on your classpath.
If you get a NoSuchMethodError, then it is on you classpath and it just
can't find a main method.

If you have any control over the application that was using Category,
you should migrate Category to Logger and Priority to Level.
Jason Roscoe
2005-03-16 17:53:59 UTC
Permalink
I am running on a windows machine, so I can't use your jar command to grep
for Category.class. If I open up my log4j jar, under org.apache.log4j, I
have a Category.class file.

I ran this:

java -classpath "..\lib\classes\log4j-1.2.9.jar" org.apache.log4j.Category

and got Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/log4j/Categoy. So I guess log4j isn't on my classpath (rmember,
I am running this on a windows machine right now).

Where do I change Category to Logger? In my application, I have

import org.apache.log4j.Logger;

-----Original Message-----
From: Curt Arnold [mailto:***@apache.org]
Sent: Wednesday, March 16, 2005 12:34 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Post by Jason Roscoe
I tried using 1.2.9 (stable) and I was able to get the
RollingFileAppend to
work. When I try running my application from a command line, I get
this
org/apache/log4j/Category
This looks like a classpath issue, not a configuration issue.
org.apache.log4j.Category was the original name for Logger and is still
in the jar to support older applications but is deprecated. So it is
likely that you have a class that uses Category, but your classpath is
not set up to find the log4j jar.

You can confirm that o.a.l.Category is in your jar file by:

jar -tf log4j-1.2.9.jar | grep Category.class

You can check if it is on your classpath by

java [classpath stuff] org.apache.log4j.Category

if you get a NoClassDefFoundError, then log4j isn't on your classpath.
If you get a NoSuchMethodError, then it is on you classpath and it just
can't find a main method.

If you have any control over the application that was using Category,
you should migrate Category to Logger and Priority to Level.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-***@logging.apache.org
For additional commands, e-mail: log4j-user-***@logging.apache.org




Disclaimer: This e-mail message is intended only for the personal use of
the recipient(s) named above. If you are not an intended recipient, you
may not review, copy or distribute this message. If you have received this
communication in error, please notify us immediately by e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or distributed
without this statement.
James Stauffer
2005-03-16 18:00:45 UTC
Permalink
Is log4j in your classpath twice?
Post by Jason Roscoe
I am running on a windows machine, so I can't use your jar command to grep
for Category.class. If I open up my log4j jar, under org.apache.log4j, I
have a Category.class file.
java -classpath "..\lib\classes\log4j-1.2.9.jar" org.apache.log4j.Category
org/apache/log4j/Categoy. So I guess log4j isn't on my classpath (rmember,
I am running this on a windows machine right now).
Where do I change Category to Logger? In my application, I have
import org.apache.log4j.Logger;
-----Original Message-----
Sent: Wednesday, March 16, 2005 12:34 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Post by Jason Roscoe
I tried using 1.2.9 (stable) and I was able to get the
RollingFileAppend to
work. When I try running my application from a command line, I get
this
org/apache/log4j/Category
This looks like a classpath issue, not a configuration issue.
org.apache.log4j.Category was the original name for Logger and is still
in the jar to support older applications but is deprecated. So it is
likely that you have a class that uses Category, but your classpath is
not set up to find the log4j jar.
jar -tf log4j-1.2.9.jar | grep Category.class
You can check if it is on your classpath by
java [classpath stuff] org.apache.log4j.Category
if you get a NoClassDefFoundError, then log4j isn't on your classpath.
If you get a NoSuchMethodError, then it is on you classpath and it just
can't find a main method.
If you have any control over the application that was using Category,
you should migrate Category to Logger and Priority to Level.
---------------------------------------------------------------------
Disclaimer: This e-mail message is intended only for the personal use of
the recipient(s) named above. If you are not an intended recipient, you
may not review, copy or distribute this message. If you have received this
communication in error, please notify us immediately by e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or distributed
without this statement.
---------------------------------------------------------------------
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/
Jason Roscoe
2005-03-16 20:22:16 UTC
Permalink
I was able to get this to run on a linux box, adding a manifest file with
the classpaths in there. But, when I try to run the same jar file on my
windows box, I get Exception in thread "main"
java.lang.NoClassDefFoundError: org/apache/log4j/Category

Could this have something to do with my windows classpath missing something?

-----Original Message-----
From: Curt Arnold [mailto:***@apache.org]
Sent: Wednesday, March 16, 2005 12:34 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Post by Jason Roscoe
I tried using 1.2.9 (stable) and I was able to get the
RollingFileAppend to
work. When I try running my application from a command line, I get
this
org/apache/log4j/Category
This looks like a classpath issue, not a configuration issue.
org.apache.log4j.Category was the original name for Logger and is still
in the jar to support older applications but is deprecated. So it is
likely that you have a class that uses Category, but your classpath is
not set up to find the log4j jar.

You can confirm that o.a.l.Category is in your jar file by:

jar -tf log4j-1.2.9.jar | grep Category.class

You can check if it is on your classpath by

java [classpath stuff] org.apache.log4j.Category

if you get a NoClassDefFoundError, then log4j isn't on your classpath.
If you get a NoSuchMethodError, then it is on you classpath and it just
can't find a main method.

If you have any control over the application that was using Category,
you should migrate Category to Logger and Priority to Level.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-***@logging.apache.org
For additional commands, e-mail: log4j-user-***@logging.apache.org




Disclaimer: This e-mail message is intended only for the personal use of
the recipient(s) named above. If you are not an intended recipient, you
may not review, copy or distribute this message. If you have received this
communication in error, please notify us immediately by e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or distributed
without this statement.
Rieser, Michael (SCI TW)
2005-03-16 20:39:02 UTC
Permalink
On Windows try:

jar -tf log4j-1.2.9.jar | find "Category.class"

Note: the double quotes ("") are necessary.

Mike
Post by Jason Roscoe
-----Original Message-----
Sent: Wednesday, March 16, 2005 11:54 AM
To: 'Log4J Users List'
Subject: RE: RollingFileAppender
I am running on a windows machine, so I can't use your jar
command to grep
for Category.class. If I open up my log4j jar, under
org.apache.log4j, I
have a Category.class file.
java -classpath "..\lib\classes\log4j-1.2.9.jar"
org.apache.log4j.Category
org/apache/log4j/Categoy. So I guess log4j isn't on my
classpath (rmember,
I am running this on a windows machine right now).
Where do I change Category to Logger? In my application, I have
import org.apache.log4j.Logger;
-----Original Message-----
Sent: Wednesday, March 16, 2005 12:34 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Post by Jason Roscoe
I tried using 1.2.9 (stable) and I was able to get the
RollingFileAppend to
work. When I try running my application from a command line, I get
this
org/apache/log4j/Category
This looks like a classpath issue, not a configuration issue.
org.apache.log4j.Category was the original name for Logger
and is still
in the jar to support older applications but is deprecated. So it is
likely that you have a class that uses Category, but your
classpath is
not set up to find the log4j jar.
jar -tf log4j-1.2.9.jar | grep Category.class
You can check if it is on your classpath by
java [classpath stuff] org.apache.log4j.Category
if you get a NoClassDefFoundError, then log4j isn't on your
classpath.
If you get a NoSuchMethodError, then it is on you classpath
and it just
can't find a main method.
If you have any control over the application that was using Category,
you should migrate Category to Logger and Priority to Level.
---------------------------------------------------------------------
Disclaimer: This e-mail message is intended only for the
personal use of
the recipient(s) named above. If you are not an intended
recipient, you
may not review, copy or distribute this message. If you have
received this
communication in error, please notify us immediately by
e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or
distributed
without this statement.
---------------------------------------------------------------------
Jason Roscoe
2005-03-16 20:40:13 UTC
Permalink
I can't run 'jar', I get this error:

'jar' is not recognized as an internal or external command,
operable program or batch file.

-----Original Message-----
From: Rieser, Michael (SCI TW) [mailto:***@stercomm.com]
Sent: Wednesday, March 16, 2005 3:39 PM
To: Log4J Users List
Subject: RE: RollingFileAppender

On Windows try:

jar -tf log4j-1.2.9.jar | find "Category.class"

Note: the double quotes ("") are necessary.

Mike
Post by Jason Roscoe
-----Original Message-----
Sent: Wednesday, March 16, 2005 11:54 AM
To: 'Log4J Users List'
Subject: RE: RollingFileAppender
I am running on a windows machine, so I can't use your jar
command to grep
for Category.class. If I open up my log4j jar, under
org.apache.log4j, I
have a Category.class file.
java -classpath "..\lib\classes\log4j-1.2.9.jar"
org.apache.log4j.Category
org/apache/log4j/Categoy. So I guess log4j isn't on my
classpath (rmember,
I am running this on a windows machine right now).
Where do I change Category to Logger? In my application, I have
import org.apache.log4j.Logger;
-----Original Message-----
Sent: Wednesday, March 16, 2005 12:34 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Post by Jason Roscoe
I tried using 1.2.9 (stable) and I was able to get the
RollingFileAppend to
work. When I try running my application from a command line, I get
this
org/apache/log4j/Category
This looks like a classpath issue, not a configuration issue.
org.apache.log4j.Category was the original name for Logger
and is still
in the jar to support older applications but is deprecated. So it is
likely that you have a class that uses Category, but your
classpath is
not set up to find the log4j jar.
jar -tf log4j-1.2.9.jar | grep Category.class
You can check if it is on your classpath by
java [classpath stuff] org.apache.log4j.Category
if you get a NoClassDefFoundError, then log4j isn't on your
classpath.
If you get a NoSuchMethodError, then it is on you classpath
and it just
can't find a main method.
If you have any control over the application that was using Category,
you should migrate Category to Logger and Priority to Level.
---------------------------------------------------------------------
Disclaimer: This e-mail message is intended only for the
personal use of
the recipient(s) named above. If you are not an intended
recipient, you
may not review, copy or distribute this message. If you have
received this
communication in error, please notify us immediately by
e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or
distributed
without this statement.
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-***@logging.apache.org
For additional commands, e-mail: log4j-user-***@logging.apache.org
Jason Roscoe
2005-03-16 20:47:35 UTC
Permalink
Sorry, I got it to work, I get this back

org/apache/log4j/Category.class
org/apache/log4j/spi/RootCategory.class

-----Original Message-----
From: Rieser, Michael (SCI TW) [mailto:***@stercomm.com]
Sent: Wednesday, March 16, 2005 3:39 PM
To: Log4J Users List
Subject: RE: RollingFileAppender

On Windows try:

jar -tf log4j-1.2.9.jar | find "Category.class"

Note: the double quotes ("") are necessary.

Mike
Post by Jason Roscoe
-----Original Message-----
Sent: Wednesday, March 16, 2005 11:54 AM
To: 'Log4J Users List'
Subject: RE: RollingFileAppender
I am running on a windows machine, so I can't use your jar
command to grep
for Category.class. If I open up my log4j jar, under
org.apache.log4j, I
have a Category.class file.
java -classpath "..\lib\classes\log4j-1.2.9.jar"
org.apache.log4j.Category
org/apache/log4j/Categoy. So I guess log4j isn't on my
classpath (rmember,
I am running this on a windows machine right now).
Where do I change Category to Logger? In my application, I have
import org.apache.log4j.Logger;
-----Original Message-----
Sent: Wednesday, March 16, 2005 12:34 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Post by Jason Roscoe
I tried using 1.2.9 (stable) and I was able to get the
RollingFileAppend to
work. When I try running my application from a command line, I get
this
org/apache/log4j/Category
This looks like a classpath issue, not a configuration issue.
org.apache.log4j.Category was the original name for Logger
and is still
in the jar to support older applications but is deprecated. So it is
likely that you have a class that uses Category, but your
classpath is
not set up to find the log4j jar.
jar -tf log4j-1.2.9.jar | grep Category.class
You can check if it is on your classpath by
java [classpath stuff] org.apache.log4j.Category
if you get a NoClassDefFoundError, then log4j isn't on your
classpath.
If you get a NoSuchMethodError, then it is on you classpath
and it just
can't find a main method.
If you have any control over the application that was using Category,
you should migrate Category to Logger and Priority to Level.
---------------------------------------------------------------------
Disclaimer: This e-mail message is intended only for the
personal use of
the recipient(s) named above. If you are not an intended
recipient, you
may not review, copy or distribute this message. If you have
received this
communication in error, please notify us immediately by
e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or
distributed
without this statement.
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-***@logging.apache.org
For additional commands, e-mail: log4j-user-***@logging.apache.org
James Stauffer
2005-03-16 20:55:45 UTC
Permalink
Another option: Get UnixUtils from http://unxutils.sourceforge.net/.
Just extract, add usr/bin/wbin to you path, and you are set.


On Wed, 16 Mar 2005 14:39:02 -0600, Rieser, Michael (SCI TW)
Post by Rieser, Michael (SCI TW)
jar -tf log4j-1.2.9.jar | find "Category.class"
Note: the double quotes ("") are necessary.
Mike
Post by Jason Roscoe
-----Original Message-----
Sent: Wednesday, March 16, 2005 11:54 AM
To: 'Log4J Users List'
Subject: RE: RollingFileAppender
I am running on a windows machine, so I can't use your jar
command to grep
for Category.class. If I open up my log4j jar, under
org.apache.log4j, I
have a Category.class file.
java -classpath "..\lib\classes\log4j-1.2.9.jar"
org.apache.log4j.Category
org/apache/log4j/Categoy. So I guess log4j isn't on my
classpath (rmember,
I am running this on a windows machine right now).
Where do I change Category to Logger? In my application, I have
import org.apache.log4j.Logger;
-----Original Message-----
Sent: Wednesday, March 16, 2005 12:34 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Post by Jason Roscoe
I tried using 1.2.9 (stable) and I was able to get the
RollingFileAppend to
work. When I try running my application from a command line, I get
this
org/apache/log4j/Category
This looks like a classpath issue, not a configuration issue.
org.apache.log4j.Category was the original name for Logger
and is still
in the jar to support older applications but is deprecated. So it is
likely that you have a class that uses Category, but your
classpath is
not set up to find the log4j jar.
jar -tf log4j-1.2.9.jar | grep Category.class
You can check if it is on your classpath by
java [classpath stuff] org.apache.log4j.Category
if you get a NoClassDefFoundError, then log4j isn't on your
classpath.
If you get a NoSuchMethodError, then it is on you classpath
and it just
can't find a main method.
If you have any control over the application that was using Category,
you should migrate Category to Logger and Priority to Level.
---------------------------------------------------------------------
Disclaimer: This e-mail message is intended only for the
personal use of
the recipient(s) named above. If you are not an intended
recipient, you
may not review, copy or distribute this message. If you have
received this
communication in error, please notify us immediately by
e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or
distributed
without this statement.
---------------------------------------------------------------------
---------------------------------------------------------------------
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/
Jason Roscoe
2005-03-17 14:26:08 UTC
Permalink
What will this give me? I downloaded this and added usr/bin/wbin to my
windows path variable and that didn't help anything

-----Original Message-----
From: James Stauffer [mailto:***@gmail.com]
Sent: Wednesday, March 16, 2005 3:56 PM
To: Log4J Users List
Subject: Re: RollingFileAppender

Another option: Get UnixUtils from http://unxutils.sourceforge.net/.
Just extract, add usr/bin/wbin to you path, and you are set.


On Wed, 16 Mar 2005 14:39:02 -0600, Rieser, Michael (SCI TW)
Post by Rieser, Michael (SCI TW)
jar -tf log4j-1.2.9.jar | find "Category.class"
Note: the double quotes ("") are necessary.
Mike
Post by Jason Roscoe
-----Original Message-----
Sent: Wednesday, March 16, 2005 11:54 AM
To: 'Log4J Users List'
Subject: RE: RollingFileAppender
I am running on a windows machine, so I can't use your jar
command to grep
for Category.class. If I open up my log4j jar, under
org.apache.log4j, I
have a Category.class file.
java -classpath "..\lib\classes\log4j-1.2.9.jar"
org.apache.log4j.Category
org/apache/log4j/Categoy. So I guess log4j isn't on my
classpath (rmember,
I am running this on a windows machine right now).
Where do I change Category to Logger? In my application, I have
import org.apache.log4j.Logger;
-----Original Message-----
Sent: Wednesday, March 16, 2005 12:34 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Post by Jason Roscoe
I tried using 1.2.9 (stable) and I was able to get the
RollingFileAppend to
work. When I try running my application from a command line, I get
this
org/apache/log4j/Category
This looks like a classpath issue, not a configuration issue.
org.apache.log4j.Category was the original name for Logger
and is still
in the jar to support older applications but is deprecated. So it is
likely that you have a class that uses Category, but your
classpath is
not set up to find the log4j jar.
jar -tf log4j-1.2.9.jar | grep Category.class
You can check if it is on your classpath by
java [classpath stuff] org.apache.log4j.Category
if you get a NoClassDefFoundError, then log4j isn't on your
classpath.
If you get a NoSuchMethodError, then it is on you classpath
and it just
can't find a main method.
If you have any control over the application that was using Category,
you should migrate Category to Logger and Priority to Level.
---------------------------------------------------------------------
Disclaimer: This e-mail message is intended only for the
personal use of
the recipient(s) named above. If you are not an intended
recipient, you
may not review, copy or distribute this message. If you have
received this
communication in error, please notify us immediately by
e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or
distributed
without this statement.
---------------------------------------------------------------------
---------------------------------------------------------------------
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-***@logging.apache.org
For additional commands, e-mail: log4j-user-***@logging.apache.org
James Stauffer
2005-03-18 13:43:22 UTC
Permalink
That will give you grep and many other unix utils so that you could
run the commands that were recommended. It doesn't address your issue
directly but gives you more tools to help.
Post by Jason Roscoe
What will this give me? I downloaded this and added usr/bin/wbin to my
windows path variable and that didn't help anything
-----Original Message-----
Sent: Wednesday, March 16, 2005 3:56 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Another option: Get UnixUtils from http://unxutils.sourceforge.net/.
Just extract, add usr/bin/wbin to you path, and you are set.
On Wed, 16 Mar 2005 14:39:02 -0600, Rieser, Michael (SCI TW)
Post by Rieser, Michael (SCI TW)
jar -tf log4j-1.2.9.jar | find "Category.class"
Note: the double quotes ("") are necessary.
Mike
Post by Jason Roscoe
-----Original Message-----
Sent: Wednesday, March 16, 2005 11:54 AM
To: 'Log4J Users List'
Subject: RE: RollingFileAppender
I am running on a windows machine, so I can't use your jar
command to grep
for Category.class. If I open up my log4j jar, under
org.apache.log4j, I
have a Category.class file.
java -classpath "..\lib\classes\log4j-1.2.9.jar"
org.apache.log4j.Category
org/apache/log4j/Categoy. So I guess log4j isn't on my
classpath (rmember,
I am running this on a windows machine right now).
Where do I change Category to Logger? In my application, I have
import org.apache.log4j.Logger;
-----Original Message-----
Sent: Wednesday, March 16, 2005 12:34 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Post by Jason Roscoe
I tried using 1.2.9 (stable) and I was able to get the
RollingFileAppend to
work. When I try running my application from a command line, I get
this
org/apache/log4j/Category
This looks like a classpath issue, not a configuration issue.
org.apache.log4j.Category was the original name for Logger
and is still
in the jar to support older applications but is deprecated. So it is
likely that you have a class that uses Category, but your
classpath is
not set up to find the log4j jar.
jar -tf log4j-1.2.9.jar | grep Category.class
You can check if it is on your classpath by
java [classpath stuff] org.apache.log4j.Category
if you get a NoClassDefFoundError, then log4j isn't on your
classpath.
If you get a NoSuchMethodError, then it is on you classpath
and it just
can't find a main method.
If you have any control over the application that was using Category,
you should migrate Category to Logger and Priority to Level.
---------------------------------------------------------------------
Disclaimer: This e-mail message is intended only for the
personal use of
the recipient(s) named above. If you are not an intended
recipient, you
may not review, copy or distribute this message. If you have
received this
communication in error, please notify us immediately by
e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or
distributed
without this statement.
---------------------------------------------------------------------
---------------------------------------------------------------------
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/
Jason Roscoe
2005-03-18 13:49:38 UTC
Permalink
I got the jar command to work, I had to run it within the directory I have
java installed, so what else should I check? I ran:

C:\j2sdk1.4.2_05\bin>jar -tf "c:\Documents and
Settings\PRGJR1\.maven\repository
\log4j\jars"\log4j-1.2.9.jar | find "Category.class"

And got this:

org/apache/log4j/Category.class
org/apache/log4j/spi/RootCategory.class

So the Category class is there. I am not referencing Category anywhere in
my application, so I'm not sure why it is looking for Category? What else
can I try to get this working on my windows machine?

Thanks for all the help!! I could attach my .jar file if that would help.

-----Original Message-----
From: James Stauffer [mailto:***@gmail.com]
Sent: Friday, March 18, 2005 8:43 AM
To: Log4J Users List
Subject: Re: RollingFileAppender

That will give you grep and many other unix utils so that you could
run the commands that were recommended. It doesn't address your issue
directly but gives you more tools to help.
Post by Jason Roscoe
What will this give me? I downloaded this and added usr/bin/wbin to my
windows path variable and that didn't help anything
-----Original Message-----
Sent: Wednesday, March 16, 2005 3:56 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Another option: Get UnixUtils from http://unxutils.sourceforge.net/.
Just extract, add usr/bin/wbin to you path, and you are set.
On Wed, 16 Mar 2005 14:39:02 -0600, Rieser, Michael (SCI TW)
Post by Rieser, Michael (SCI TW)
jar -tf log4j-1.2.9.jar | find "Category.class"
Note: the double quotes ("") are necessary.
Mike
Post by Jason Roscoe
-----Original Message-----
Sent: Wednesday, March 16, 2005 11:54 AM
To: 'Log4J Users List'
Subject: RE: RollingFileAppender
I am running on a windows machine, so I can't use your jar
command to grep
for Category.class. If I open up my log4j jar, under
org.apache.log4j, I
have a Category.class file.
java -classpath "..\lib\classes\log4j-1.2.9.jar"
org.apache.log4j.Category
org/apache/log4j/Categoy. So I guess log4j isn't on my
classpath (rmember,
I am running this on a windows machine right now).
Where do I change Category to Logger? In my application, I have
import org.apache.log4j.Logger;
-----Original Message-----
Sent: Wednesday, March 16, 2005 12:34 PM
To: Log4J Users List
Subject: Re: RollingFileAppender
Post by Jason Roscoe
I tried using 1.2.9 (stable) and I was able to get the
RollingFileAppend to
work. When I try running my application from a command line, I get
this
org/apache/log4j/Category
This looks like a classpath issue, not a configuration issue.
org.apache.log4j.Category was the original name for Logger
and is still
in the jar to support older applications but is deprecated. So it is
likely that you have a class that uses Category, but your
classpath is
not set up to find the log4j jar.
jar -tf log4j-1.2.9.jar | grep Category.class
You can check if it is on your classpath by
java [classpath stuff] org.apache.log4j.Category
if you get a NoClassDefFoundError, then log4j isn't on your
classpath.
If you get a NoSuchMethodError, then it is on you classpath
and it just
can't find a main method.
If you have any control over the application that was using Category,
you should migrate Category to Logger and Priority to Level.
---------------------------------------------------------------------
Disclaimer: This e-mail message is intended only for the
personal use of
the recipient(s) named above. If you are not an intended
recipient, you
may not review, copy or distribute this message. If you have
received this
communication in error, please notify us immediately by
e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or
distributed
without this statement.
---------------------------------------------------------------------
---------------------------------------------------------------------
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-***@logging.apache.org
For additional commands, e-mail: log4j-user-***@logging.apache.org
Loading...