You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "John B. Moore" <jb...@microps.com> on 2004/02/06 23:56:23 UTC
Logs, where art thou????
I'm stumped.. I can't get the log files to appear ANYWHERE on a
windows install..
System
WinXP
Apache 2.0.43
Tomcat 4.1.18
Upgraded to Log4j 1.2.8
Log4j.properties
===========
# root category priority
log4j.rootCategory=DEBUG, A1, R1
# A1 is a Console Appender
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# R1 is a Rolling file appender
log4j.appender.R1=org.apache.log4j.RollingFileAppender
log4j.appender.R1.File=D:/Apache_Group/Tomcat41/logs/schedulerweb.log
# File Size
log4j.appender.R1.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R1.MaxBackupIndex=2
# Output Patterns
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t](%F:%L) %-5p - %m%n
log4j.appender.R1.layout=org.apache.log4j.PatternLayout
log4j.appender.R1.layout.ConversionPattern=%-4r [%t](%F:%L) %-5p - %m%n
=========================
I have tried
log4j.appender.R1.File=D:\\Apache_Group\\Tomcat41\\logs\\schedulerweb.log
..and searched this list for any other suggestions. I have checked
the suggestions that the log file would be in other locations.. infact
have searched both HD of this machine extensively. no joy..
I remember having this problem before with Log4j on a windows machine
(NT4) and the newer Tomcat, and as I remember it never got a solution,
never had this problem older versions of Tomcat.
When I run Tomcat "IN" JBuilder (which is 4.1.27) the log files show
up in the main Tomcat directory which is fine.. for development I used
log4j.appender.R1.File=schedulerweb.log
..that does not work either...
I'm now beginning to think that it is something deeper going on with
tomcat.. Reason is I can not find any output for "System.out.println"
statments in the Controller servlet with the exception of "one lonely
output" in the stdout.log. Real strange is that one output is in the
middle of a number of various configuations "System.out.println"
statments before the logger is instantiated.. ???
Anyway for the curious, the following is the base instantiation for my
logger.. (which has worked fine for years...)
g_logLogger = Logger.getLogger( this.getClass().getName() );
this.g_urlLog4j = (java.net.URL)this.g_appcontext.getAttribute("LogUrl");
if (this.g_urlLog4j == null) {
try {
this.g_urlLog4j =
g_appcontext.getResource("/conf/Log4j.properties");
System.out.println(">>Log4j Prop URL: "+this.g_urlLog4j.toString());
PropertyConfigurator.configure(this.g_urlLog4j);
g_appcontext.setAttribute("LogUrl",this.g_urlLog4j);
}
catch (java.net.MalformedURLException mex) {
mex.printStackTrace();
} catch (Exception ex) {
ex.printStackTrace();
}
} else {
PropertyConfigurator.configure(this.g_urlLog4j);
}
John..
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Logs, where art thou????
Posted by Jacob Kjome <ho...@visi.com>.
At 03:51 PM 2/7/2004 -0800, you wrote:
>Update,
>
> Well, when the going gets wierd, go back to basics...
Good call
> To that end I created a simple servlet that had println
> statments... They came out as I hoped in the stdout.log file.. I then
> pasted the Log4j intialization from the problem app to create a Logger..
> that also output to the stdout.log.. (it has a ConsoleAppender) Gooood
> news.. It still was not creating the named log file in the Tomcat root
> directory.. so I changed that to a hard path to the log directory and
> that is now showing up..
Note that if you use relative paths, the location of your log file will be
relative to the directory from which the VM was started. If you are using
the service, I suggest looking in c:\WINNT\system32 (or c:\WINDOWS\system32
on WinXP).
> Now I need to figure out what it is that is mucking up everything in
> the full app....<sigh>
Good luck!
Jake
> John...
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Logs, where art thou????
Posted by "John B. Moore" <jb...@microps.com>.
Sometimes it is threaputic to face one's stupidity...
Anyway, it was pilot error... I use JBuilder (which has an embedded
Tomcat) for my development and in versions prior to the latest (JB9 and
before) the url pattern was
http://localhost:8080/servercontext/servletname
..in JB10 this changed to ...
http://localhost:8080/servletname
.. I had gotten use to this "pattern" and my servlet context and name
were very nearly identical.. so I had entered what amounted to....
http://serverhere/servercontext
..instead of getting a "resource not found" or somesuch... it loaded
because Tomcat loaded
http://serverhere/servercontext/index.jsp
...which in my application was NEVER loaded by itself and only should be
loaded by the controller servlet after extensive setup and
configuration.. The error was just enough "legitimate" looking that it
did not flag what was really happening.. and I never clued in on what
was really happening until I had gutted my controller to load a simple
"html" form and instead the index.jsp still loaded...
<sign>
John..
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Logs, where art thou????
Posted by "John B. Moore" <jb...@microps.com>.
Thanks for you thoughts...
I did not go into detail earlier as I did not seem relevant.. but
just FYI ... The original problem was on Tomcat 4.1.29.. I never use
the bleeding edge versions but download what "at that time" was
indicated as the best "stable build" On my Windows dev machine I have
4.1.18 and since it behaved the same I did not think that upgrading it
at that point would be any help..
Your points on installers are understood, I just never had any
problems with them so it did not seem a issue. Also I NEVER put anything
in the Program Files directory.. and I rarely use any MS products so
nuking that directory would not have been noticed..<G> (actually I only
use Windows when a client requires it, my real machines are Linux and
MacOSX..)
I'm working on moving from the simple case to the original app and
hope I can track down what mucked things up.. I'll post my results later...
John..
Jacob Kjome wrote:
> I'm really not sure. You can try and do as I suggest above and not
> use the installer (and maybe move to a version of Tomcat that is
> actually current. 4.1.18 is ancient. Heck, 5.0.18 is out already...
> and quite stabe, if you as me). First I suggest you get
> System.out.println() to show up. Until this works, I can't see how
> you can begin to figure out how this relates to Log4j. I recommend
> sending a message to the Tomcat-user list about this.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Logs, where art thou????
Posted by Jacob Kjome <ho...@visi.com>.
At 07:29 PM 2/7/2004 +0000, you wrote:
>Thanks..
>
>Sorry, but you are loosing me a bit here...
>
>I installed tomcat with the binary for windows..
>
>jakarta-tomcat-4.1.18.exe
>
>and it installed the "service".. (can I assume it installed it
>correctly..??)
I wouldn't assume anything. I *never* use the installer for the very
reason that I don't know what it is doing and I can just as easily simply
unzip the zipped or gzipped archives to a directory and run. I don't even
know why they make an installer? I guess just to give the illusion that
Tomcat is a traditional application? I'm glad I didn't use a recent
nightly of the Mozilla installer. It had a nifty new "feature" where it
deleted the contents of "Program Files". That's fixed now and those builds
have been removed from Mozilla's archives, but I bet at least a few people
actually experienced the deleting of all of their programs. Of course, it
never would have affected me since I simply use the zipped archive and
ignore the installer in that case as well. Hmm.... pattern here? Have I
made my case for not using installers when they aren't necessary yet? Heh :-)
>I also tested this running tomcat from the command line (using the
>standard "startup.bat" file..
>
>..same problem..
>
>..so where does that leave me...???
I'm really not sure. You can try and do as I suggest above and not use the
installer (and maybe move to a version of Tomcat that is actually
current. 4.1.18 is ancient. Heck, 5.0.18 is out already... and quite
stabe, if you as me). First I suggest you get System.out.println() to show
up. Until this works, I can't see how you can begin to figure out how this
relates to Log4j. I recommend sending a message to the Tomcat-user list
about this.
Jake
> John..
>
>--- In Log4J@yahoogroups.com, Jacob Kjome <ho...@v...> wrote:
> >
> > Do you have stdout specified for the service? Here is how I would
>install
> > the 4.1.xx service...
> >
> > %CATALINA4_HOME%\bin\tomcat.exe -install Apache-Catalina4
> > %JAVA_HOME%\jre\bin\server\jvm.dll
> >
>-Djava.class.path=%CATALINA4_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar
>
> > -Dcatalina.home=%CATALINA4_HOME% %CATALINA_OPTS% -Xrs -start
> > org.apache.catalina.startup.Bootstrap -params start -stop
> > org.apache.catalina.startup.Bootstrap -params stop -out
> > %CATALINA4_HOME%\logs\stdout.log -err %CATALINA4_HOME%\logs\stderr.log
> >
> > For Tomcat5, just use "%CATALINA_HOME%\bin.\service.bat install"
> >
> > After you can start seeing System.out.println() statements, then you
>can
> > use log4j.debug=true to see what is actually going on.
> >
> > Jake
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Logs, where art thou????
Posted by "John B. Moore" <jb...@microps.com>.
Thanks..
Sorry, but you are loosing me a bit here...
I installed tomcat with the binary for windows..
jakarta-tomcat-4.1.18.exe
and it installed the "service".. (can I assume it installed it
correctly..??)
I also tested this running tomcat from the command line (using the
standard "startup.bat" file..
..same problem..
..so where does that leave me...???
John..
--- In Log4J@yahoogroups.com, Jacob Kjome <ho...@v...> wrote:
>
> Do you have stdout specified for the service? Here is how I would
install
> the 4.1.xx service...
>
> %CATALINA4_HOME%\bin\tomcat.exe -install Apache-Catalina4
> %JAVA_HOME%\jre\bin\server\jvm.dll
>
-Djava.class.path=%CATALINA4_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar
> -Dcatalina.home=%CATALINA4_HOME% %CATALINA_OPTS% -Xrs -start
> org.apache.catalina.startup.Bootstrap -params start -stop
> org.apache.catalina.startup.Bootstrap -params stop -out
> %CATALINA4_HOME%\logs\stdout.log -err %CATALINA4_HOME%\logs\stderr.log
>
> For Tomcat5, just use "%CATALINA_HOME%\bin.\service.bat install"
>
> After you can start seeing System.out.println() statements, then you
can
> use log4j.debug=true to see what is actually going on.
>
> Jake
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Logs, where art thou????
Posted by "John B. Moore" <jb...@microps.com>.
Thanks..
Sorry, but you are loosing me a bit here...
I installed tomcat with the binary for windows..
jakarta-tomcat-4.1.18.exe
and it installed the "service".. (can I assume it installed it
correctly..??)
I also tested this running tomcat from the command line (using the
standard "startup.bat" file..
..same problem..
..so where does that leave me...???
John..
--- In Log4J@yahoogroups.com, Jacob Kjome <ho...@v...> wrote:
>
> Do you have stdout specified for the service? Here is how I would
install
> the 4.1.xx service...
>
> %CATALINA4_HOME%\bin\tomcat.exe -install Apache-Catalina4
> %JAVA_HOME%\jre\bin\server\jvm.dll
>
-Djava.class.path=%CATALINA4_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar
> -Dcatalina.home=%CATALINA4_HOME% %CATALINA_OPTS% -Xrs -start
> org.apache.catalina.startup.Bootstrap -params start -stop
> org.apache.catalina.startup.Bootstrap -params stop -out
> %CATALINA4_HOME%\logs\stdout.log -err %CATALINA4_HOME%\logs\stderr.log
>
> For Tomcat5, just use "%CATALINA_HOME%\bin.\service.bat install"
>
> After you can start seeing System.out.println() statements, then you
can
> use log4j.debug=true to see what is actually going on.
>
> Jake
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Logs, where art thou????
Posted by Jacob Kjome <ho...@visi.com>.
Do you have stdout specified for the service? Here is how I would install
the 4.1.xx service...
%CATALINA4_HOME%\bin\tomcat.exe -install Apache-Catalina4
%JAVA_HOME%\jre\bin\server\jvm.dll
-Djava.class.path=%CATALINA4_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar
-Dcatalina.home=%CATALINA4_HOME% %CATALINA_OPTS% -Xrs -start
org.apache.catalina.startup.Bootstrap -params start -stop
org.apache.catalina.startup.Bootstrap -params stop -out
%CATALINA4_HOME%\logs\stdout.log -err %CATALINA4_HOME%\logs\stderr.log
For Tomcat5, just use "%CATALINA_HOME%\bin.\service.bat install"
After you can start seeing System.out.println() statements, then you can
use log4j.debug=true to see what is actually going on.
Jake
At 09:14 AM 2/7/2004 -0800, you wrote:
>Thanks... but...
>
> Can one ad that switch when running as a service.. (WinXP)..?? (no
> effect when tried in the property file..
>
> >> property file is not found...
>
> Yeah, this is concerning me.. in Tomcat 3.x I never had any problems
> with Log4j.. and when I run Tomcat 4.1.27 in JBuilder there are no
> problems finding property files and logging.. It is only when I "deploy"
> the application to the Apache/Tomcat 4.1.28 combo that I'm getting this
> mysterious behavior.. In addtion the basic System.out.println(..)
> statements are not showing up and any log files... (which would reveal
> important issues as to paths and contexts....etc..)
>
> I'm really struggling to find a foothold on this... it is so strange...
>
> John..
>
>Paul Smith wrote:
>
>>First thing I would say to to try is to add:
>>
>>log4j.debug=true
>>
>>to either your property file, OR as a -D switch to the vm arguments
>>(later is safer as it can't be missed by Log4j if for some reason your
>>property file is not being found).
>>
>>That will output any configuration log4j does to the console so you can
>>see anything. Usually Tomcat will put this in the
>>$TOMCAT_HOME/logs/catalina.out file if you run tomcat separately, or to
>>wherever stdout is set to within an IDE.
>>
>>That might help you figure out a bit more.
>>
>>cheers,
>>
>>Paul Smith
>>
>>On Sat, 2004-02-07 at 09:56, John B. Moore wrote:
>>
>>
>>>I'm stumped.. I can't get the log files to appear ANYWHERE on a
>>>windows install..
>>>
>>>System
>>> WinXP
>>> Apache 2.0.43
>>> Tomcat 4.1.18
>>>Upgraded to Log4j 1.2.8
>>>
>>>Log4j.properties
>>>
>>>===========
>>># root category priority
>>>log4j.rootCategory=DEBUG, A1, R1
>>>
>>># A1 is a Console Appender
>>>log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>>
>>>
>>># R1 is a Rolling file appender
>>>log4j.appender.R1=org.apache.log4j.RollingFileAppender
>>>log4j.appender.R1.File=D:/Apache_Group/Tomcat41/logs/schedulerweb.log
>>># File Size
>>>log4j.appender.R1.MaxFileSize=100KB
>>># Keep one backup file
>>>log4j.appender.R1.MaxBackupIndex=2
>>>
>>>
>>># Output Patterns
>>>log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>>log4j.appender.A1.layout.ConversionPattern=%-4r [%t](%F:%L) %-5p - %m%n
>>>
>>>log4j.appender.R1.layout=org.apache.log4j.PatternLayout
>>>log4j.appender.R1.layout.ConversionPattern=%-4r [%t](%F:%L) %-5p - %m%n
>>>=========================
>>>
>>>I have tried
>>>log4j.appender.R1.File=D:\\Apache_Group\\Tomcat41\\logs\\schedulerweb.log
>>>
>>>..and searched this list for any other suggestions. I have checked
>>>the suggestions that the log file would be in other locations.. infact
>>>have searched both HD of this machine extensively. no joy..
>>>
>>>I remember having this problem before with Log4j on a windows machine
>>>(NT4) and the newer Tomcat, and as I remember it never got a solution,
>>>never had this problem older versions of Tomcat.
>>>
>>>When I run Tomcat "IN" JBuilder (which is 4.1.27) the log files show
>>>up in the main Tomcat directory which is fine.. for development I used
>>>
>>>log4j.appender.R1.File=schedulerweb.log
>>>
>>>..that does not work either...
>>>
>>>I'm now beginning to think that it is something deeper going on with
>>>tomcat.. Reason is I can not find any output for "System.out.println"
>>>statments in the Controller servlet with the exception of "one lonely
>>>output" in the stdout.log. Real strange is that one output is in the
>>>middle of a number of various configuations "System.out.println"
>>>statments before the logger is instantiated.. ???
>>>
>>>Anyway for the curious, the following is the base instantiation for my
>>>logger.. (which has worked fine for years...)
>>>
>>>g_logLogger = Logger.getLogger( this.getClass().getName() );
>>>this.g_urlLog4j = (java.net.URL)this.g_appcontext.getAttribute("LogUrl");
>>>if (this.g_urlLog4j == null) {
>>> try {
>>> this.g_urlLog4j =
>>>g_appcontext.getResource("/conf/Log4j.properties");
>>> System.out.println(">>Log4j Prop URL: "+this.g_urlLog4j.toString());
>>> PropertyConfigurator.configure(this.g_urlLog4j);
>>> g_appcontext.setAttribute("LogUrl",this.g_urlLog4j);
>>> }
>>> catch (java.net.MalformedURLException mex) {
>>> mex.printStackTrace();
>>> } catch (Exception ex) {
>>> ex.printStackTrace();
>>> }
>>>} else {
>>> PropertyConfigurator.configure(this.g_urlLog4j);
>>>}
>>>
>>>
>>>
>>>John..
>>>
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>>For additional commands, e-mail: log4j-user-help@logging.apache.org
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Logs, where art thou????
Posted by "John B. Moore" <jb...@microps.com>.
Thanks... but...
Can one ad that switch when running as a service.. (WinXP)..?? (no
effect when tried in the property file..
>> property file is not found...
Yeah, this is concerning me.. in Tomcat 3.x I never had any
problems with Log4j.. and when I run Tomcat 4.1.27 in JBuilder there
are no problems finding property files and logging.. It is only when I
"deploy" the application to the Apache/Tomcat 4.1.28 combo that I'm
getting this mysterious behavior.. In addtion the basic
System.out.println(..) statements are not showing up and any log
files... (which would reveal important issues as to paths and
contexts....etc..)
I'm really struggling to find a foothold on this... it is so
strange...
John..
Paul Smith wrote:
>First thing I would say to to try is to add:
>
>log4j.debug=true
>
>to either your property file, OR as a -D switch to the vm arguments
>(later is safer as it can't be missed by Log4j if for some reason your
>property file is not being found).
>
>That will output any configuration log4j does to the console so you can
>see anything. Usually Tomcat will put this in the
>$TOMCAT_HOME/logs/catalina.out file if you run tomcat separately, or to
>wherever stdout is set to within an IDE.
>
>That might help you figure out a bit more.
>
>cheers,
>
>Paul Smith
>
>On Sat, 2004-02-07 at 09:56, John B. Moore wrote:
>
>
>>I'm stumped.. I can't get the log files to appear ANYWHERE on a
>>windows install..
>>
>>System
>> WinXP
>> Apache 2.0.43
>> Tomcat 4.1.18
>>
>>Upgraded to Log4j 1.2.8
>>
>>Log4j.properties
>>
>>===========
>># root category priority
>>log4j.rootCategory=DEBUG, A1, R1
>>
>># A1 is a Console Appender
>>log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>
>>
>># R1 is a Rolling file appender
>>log4j.appender.R1=org.apache.log4j.RollingFileAppender
>>log4j.appender.R1.File=D:/Apache_Group/Tomcat41/logs/schedulerweb.log
>># File Size
>>log4j.appender.R1.MaxFileSize=100KB
>># Keep one backup file
>>log4j.appender.R1.MaxBackupIndex=2
>>
>>
>># Output Patterns
>>log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>log4j.appender.A1.layout.ConversionPattern=%-4r [%t](%F:%L) %-5p - %m%n
>>
>>log4j.appender.R1.layout=org.apache.log4j.PatternLayout
>>log4j.appender.R1.layout.ConversionPattern=%-4r [%t](%F:%L) %-5p - %m%n
>>=========================
>>
>>I have tried
>>
>>log4j.appender.R1.File=D:\\Apache_Group\\Tomcat41\\logs\\schedulerweb.log
>>
>>..and searched this list for any other suggestions. I have checked
>>the suggestions that the log file would be in other locations.. infact
>>have searched both HD of this machine extensively. no joy..
>>
>>I remember having this problem before with Log4j on a windows machine
>>(NT4) and the newer Tomcat, and as I remember it never got a solution,
>>never had this problem older versions of Tomcat.
>>
>>When I run Tomcat "IN" JBuilder (which is 4.1.27) the log files show
>>up in the main Tomcat directory which is fine.. for development I used
>>
>>log4j.appender.R1.File=schedulerweb.log
>>
>>..that does not work either...
>>
>>I'm now beginning to think that it is something deeper going on with
>>tomcat.. Reason is I can not find any output for "System.out.println"
>>statments in the Controller servlet with the exception of "one lonely
>>output" in the stdout.log. Real strange is that one output is in the
>>middle of a number of various configuations "System.out.println"
>>statments before the logger is instantiated.. ???
>>
>>Anyway for the curious, the following is the base instantiation for my
>>logger.. (which has worked fine for years...)
>>
>>g_logLogger = Logger.getLogger( this.getClass().getName() );
>>this.g_urlLog4j = (java.net.URL)this.g_appcontext.getAttribute("LogUrl");
>>if (this.g_urlLog4j == null) {
>> try {
>> this.g_urlLog4j =
>>g_appcontext.getResource("/conf/Log4j.properties");
>> System.out.println(">>Log4j Prop URL: "+this.g_urlLog4j.toString());
>> PropertyConfigurator.configure(this.g_urlLog4j);
>> g_appcontext.setAttribute("LogUrl",this.g_urlLog4j);
>> }
>> catch (java.net.MalformedURLException mex) {
>> mex.printStackTrace();
>> } catch (Exception ex) {
>> ex.printStackTrace();
>> }
>>} else {
>> PropertyConfigurator.configure(this.g_urlLog4j);
>>}
>>
>>
>>
>>John..
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
>
>
Re: Logs, where art thou????
Posted by "John B. Moore" <jb...@microps.com>.
I tried this by editing the Catalina.bat file to add the -Dlog4j.debug
switch.. no joy...
--- In Log4J@yahoogroups.com, Paul Smith <pa...@l...> wrote:
> First thing I would say to to try is to add:
>
> log4j.debug=true
>
> to either your property file, OR as a -D switch to the vm arguments
> (later is safer as it can't be missed by Log4j if for some reason your
> property file is not being found).
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Logs, where art thou????
Posted by Paul Smith <pa...@lawlex.com.au>.
First thing I would say to to try is to add:
log4j.debug=true
to either your property file, OR as a -D switch to the vm arguments
(later is safer as it can't be missed by Log4j if for some reason your
property file is not being found).
That will output any configuration log4j does to the console so you can
see anything. Usually Tomcat will put this in the
$TOMCAT_HOME/logs/catalina.out file if you run tomcat separately, or to
wherever stdout is set to within an IDE.
That might help you figure out a bit more.
cheers,
Paul Smith
On Sat, 2004-02-07 at 09:56, John B. Moore wrote:
> I'm stumped.. I can't get the log files to appear ANYWHERE on a
> windows install..
>
> System
> WinXP
> Apache 2.0.43
> Tomcat 4.1.18
>
> Upgraded to Log4j 1.2.8
>
> Log4j.properties
>
> ===========
> # root category priority
> log4j.rootCategory=DEBUG, A1, R1
>
> # A1 is a Console Appender
> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>
>
> # R1 is a Rolling file appender
> log4j.appender.R1=org.apache.log4j.RollingFileAppender
> log4j.appender.R1.File=D:/Apache_Group/Tomcat41/logs/schedulerweb.log
> # File Size
> log4j.appender.R1.MaxFileSize=100KB
> # Keep one backup file
> log4j.appender.R1.MaxBackupIndex=2
>
>
> # Output Patterns
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> log4j.appender.A1.layout.ConversionPattern=%-4r [%t](%F:%L) %-5p - %m%n
>
> log4j.appender.R1.layout=org.apache.log4j.PatternLayout
> log4j.appender.R1.layout.ConversionPattern=%-4r [%t](%F:%L) %-5p - %m%n
> =========================
>
> I have tried
>
> log4j.appender.R1.File=D:\\Apache_Group\\Tomcat41\\logs\\schedulerweb.log
>
> ..and searched this list for any other suggestions. I have checked
> the suggestions that the log file would be in other locations.. infact
> have searched both HD of this machine extensively. no joy..
>
> I remember having this problem before with Log4j on a windows machine
> (NT4) and the newer Tomcat, and as I remember it never got a solution,
> never had this problem older versions of Tomcat.
>
> When I run Tomcat "IN" JBuilder (which is 4.1.27) the log files show
> up in the main Tomcat directory which is fine.. for development I used
>
> log4j.appender.R1.File=schedulerweb.log
>
> ..that does not work either...
>
> I'm now beginning to think that it is something deeper going on with
> tomcat.. Reason is I can not find any output for "System.out.println"
> statments in the Controller servlet with the exception of "one lonely
> output" in the stdout.log. Real strange is that one output is in the
> middle of a number of various configuations "System.out.println"
> statments before the logger is instantiated.. ???
>
> Anyway for the curious, the following is the base instantiation for my
> logger.. (which has worked fine for years...)
>
> g_logLogger = Logger.getLogger( this.getClass().getName() );
> this.g_urlLog4j = (java.net.URL)this.g_appcontext.getAttribute("LogUrl");
> if (this.g_urlLog4j == null) {
> try {
> this.g_urlLog4j =
> g_appcontext.getResource("/conf/Log4j.properties");
> System.out.println(">>Log4j Prop URL: "+this.g_urlLog4j.toString());
> PropertyConfigurator.configure(this.g_urlLog4j);
> g_appcontext.setAttribute("LogUrl",this.g_urlLog4j);
> }
> catch (java.net.MalformedURLException mex) {
> mex.printStackTrace();
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> } else {
> PropertyConfigurator.configure(this.g_urlLog4j);
> }
>
>
>
> John..
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Logs, where art thou????
Posted by "John B. Moore" <jb...@microps.com>.
Update,
Well, when the going gets wierd, go back to basics...
To that end I created a simple servlet that had println
statments... They came out as I hoped in the stdout.log file.. I
then pasted the Log4j intialization from the problem app to create a
Logger.. that also output to the stdout.log.. (it has a
ConsoleAppender) Gooood news.. It still was not creating the named log
file in the Tomcat root directory.. so I changed that to a hard path to
the log directory and that is now showing up..
Now I need to figure out what it is that is mucking up everything
in the full app....<sigh>
John...
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org