You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lyallex <ly...@gmail.com> on 2012/12/04 19:35:48 UTC
Running Tomcat under jsvc - logging problems
Hi
apache-tomcat-6.0.36
CentOS
uname -m = i686
uname -r = 2.6.18-028stab070.14-ent
uname -s = Linux :-)
jdk1.6.0_07
I have recently upgraded my production server from apache-tomcat-6.0.18 to
6.0.36 so that my live and dev
env's are as similar as possible
6.0.18 runs fine and logs as expected, this version was already installed
when I
started renting the server from the hosting company, it runs as user tomcat
under jsvc.
I compiled jsvc from the source included in the 6.0.36 distro
following the instructions in the tomcat docs and copied
/etc/init.d/tomcat6 (the old start/stop script) to
/etc/init.d/tomcat. I modified the file to point to the new version and
started the server
/etc/init.d/tomcat has been pasted at http://pastebin.com/ihGDJb1C for your
perusal should you wish.
Actually Tomcat runs fine, it serves my site and carries a good load (200+
sessions concurrently with no apparent degradation)
there is no Apache front end, Tomcat runs standalone. The problem is with
the logging
/etc/init.d/tomcat has the following two lines
-outfile $CATALINA_HOME/logs/catalina.out \
-errfile $CATALINA_HOME/logs/catalina.err \
And here's the problem. Most of the logging output ends up in catalina.err
even though there are no errors in the logs
occasionally a few lines from my application loggers end up in
catalina.out. I also have logging.properties
in WEB-INF/classes. This has been around ever since I deployed the first
version of my app a couple of years ago
and has always produced the expected output. Now I get nothing.
The hosting companies preferred solution is to recompile tomcat 'for a one
off fee' (I kid you not). I'm pretty sure that Tomcat doesn't need
rebuilding to run under jsvc
and if it does I'm quite capable of building it myself, so no help there
then ...
logging.properties reproduced below just FYI if you want it.
Any advice on how I can get the logging working will be much appreciated
Lyallex
handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
org.apache.juli.FileHandler.level = ALL
org.apache.juli.FileHandler.directory = ${catalina.base}/logs
org.apache.juli.FileHandler.prefix = MyApp.
java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter =
java.util.logging.SimpleFormatter
Re: Running Tomcat under jsvc - logging problems
Posted by Lyallex <ly...@gmail.com>.
On 4 December 2012 21:18, Konstantin Kolinko <kn...@gmail.com> wrote:
> 2012/12/5 Lyallex <ly...@gmail.com>:
> > On 4 December 2012 19:41, Konstantin Kolinko <kn...@gmail.com>
> wrote:
> >
> >> 2012/12/4 Lyallex <ly...@gmail.com>:
> >> > On 4 December 2012 18:50, Konstantin Kolinko <kn...@gmail.com>
> >> wrote:
>
> [snip]
> Moreover, I think it should run just fine with an older jsvc.
>
>
OK, thanks for your assistance, it seems fairly obvious then that there is
some aspect of the logging config that I've missed.
I've never really got my head around logging, It's a bit like a washing
machine, I don't know or care how it works, it just does.
I suppose I'll have to start reading ... I've just got so many more
interesting things to be getting on with.
Ho Hum
Thanks again
Lyallex
Re: Running Tomcat under jsvc - logging problems
Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/12/5 Lyallex <ly...@gmail.com>:
> On 4 December 2012 19:41, Konstantin Kolinko <kn...@gmail.com> wrote:
>
>> 2012/12/4 Lyallex <ly...@gmail.com>:
>> > On 4 December 2012 18:50, Konstantin Kolinko <kn...@gmail.com>
>> wrote:
>> >>
>> [snip]
>>
>
>
>>
>>
>> I do not know why it worked in 6.0.18.
>>
>
> No, nor do I but I've (apparently) reproduced the 0.18 config for the 0.36
> instance and the logging works in the former
> and not in the latter
>
> I just need to get something straight, maybe you can help me.
>
> I say that Tomcat 6.0.36 binary distribution should run under jsvc without
> needing a recompile.
Yes. You do not need to recompile Tomcat itself to run it on Linux
(with or without jsvc). It is a java application and its binaries
(jars) are platform-independent.
Moreover, I think it should run just fine with an older jsvc.
> Is this correct (I hope it is because it's running fine right now out of
> the box except for the logging)
>
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Running Tomcat under jsvc - logging problems
Posted by Lyallex <ly...@gmail.com>.
On 4 December 2012 19:41, Konstantin Kolinko <kn...@gmail.com> wrote:
> 2012/12/4 Lyallex <ly...@gmail.com>:
> > On 4 December 2012 18:50, Konstantin Kolinko <kn...@gmail.com>
> wrote:
> >>
> [snip]
>
>
>
> I do not know why it worked in 6.0.18.
>
No, nor do I but I've (apparently) reproduced the 0.18 config for the 0.36
instance and the logging works in the former
and not in the latter
I just need to get something straight, maybe you can help me.
I say that Tomcat 6.0.36 binary distribution should run under jsvc without
needing a recompile.
Is this correct (I hope it is because it's running fine right now out of
the box except for the logging)
Thanks for taking the time to reply
Lyallex
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Re: Running Tomcat under jsvc - logging problems
Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/12/4 Lyallex <ly...@gmail.com>:
> On 4 December 2012 18:50, Konstantin Kolinko <kn...@gmail.com> wrote:
>>
>> 1. "java.util.logging.ConsoleHandler" prints to System.err.
>>
>> Some other "console logging" implementations log to System.out.
>>
>> Do you need a ConsoleHandler at all? (You are effectively printing the
>> same log messages into two places a) ConsoleHandler, b) FileHandler ).
>>
>
> Well possibly not but it's irrelevant as logging.properties is being
> ignored
> so I don't get the output anyway, particularly I get no log file named
> MyApp ...
>
>
>>
>> 2. To initialize logging properly you need to configure system
>> properties "java.util.logging.config.file" and
>> "java.util.logging.manager"
>> the same way as they are set by catalina.sh file.
>>
>> Have you specified the "java.util.logging.manager" property in your
>> arguments to jsvc?
>>
>
> Well no but then I never had it with 6.0.18 and that logged perfectly,
> also catalina.sh is not executed when running under jsvc but I think you may
> just be using that as an example ... I hope
Yes, as an example.
I'd also recommend to use daemon.sh that is included with Tomcat 7.
I do not know why it worked in 6.0.18. Have you checked with what
arguments it runs (e.g. via /proc/) ? You say that it wasn't you who
installed 6.0.18. There is usually a wrapper script, like that
daemon.sh.
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Running Tomcat under jsvc - logging problems
Posted by Lyallex <ly...@gmail.com>.
On 4 December 2012 18:50, Konstantin Kolinko <kn...@gmail.com> wrote:
> [snip]
> >
> > Any advice on how I can get the logging working will be much appreciated
> >
> >
> > Lyallex
> >
> >
> >
> > handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
> >
> > ############################################################
> > # Handler specific properties.
> > # Describes specific configuration info for Handlers.
> > ############################################################
> >
> > org.apache.juli.FileHandler.level = ALL
> > org.apache.juli.FileHandler.directory = ${catalina.base}/logs
> > org.apache.juli.FileHandler.prefix = MyApp.
> >
> > java.util.logging.ConsoleHandler.level = ALL
> > java.util.logging.ConsoleHandler.formatter =
> > java.util.logging.SimpleFormatter
>
>
>
> 1. "java.util.logging.ConsoleHandler" prints to System.err.
>
> Some other "console logging" implementations log to System.out.
>
> Do you need a ConsoleHandler at all? (You are effectively printing the
> same log messages into two places a) ConsoleHandler, b) FileHandler ).
>
Well possibly not but it's irrelevant as logging.properties is being
ignored
so I don't get the output anyway, particularly I get no log file named
MyApp ...
>
> 2. To initialize logging properly you need to configure system
> properties "java.util.logging.config.file" and
> "java.util.logging.manager"
> the same way as they are set by catalina.sh file.
>
> Have you specified the "java.util.logging.manager" property in your
> arguments to jsvc?
>
Well no but then I never had it with 6.0.18 and that logged perfectly,
also catalina.sh is not executed when running under jsvc but I think you may
just be using that as an example ... I hope
sigh
I'll look into it
Thanks
Lyallex
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Re: Running Tomcat under jsvc - logging problems
Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/12/4 Lyallex <ly...@gmail.com>:
> Hi
>
> apache-tomcat-6.0.36
> CentOS
> uname -m = i686
> uname -r = 2.6.18-028stab070.14-ent
> uname -s = Linux :-)
> jdk1.6.0_07
>
> I have recently upgraded my production server from apache-tomcat-6.0.18 to
> 6.0.36 so that my live and dev
> env's are as similar as possible
>
> 6.0.18 runs fine and logs as expected, this version was already installed
> when I
> started renting the server from the hosting company, it runs as user tomcat
> under jsvc.
>
> I compiled jsvc from the source included in the 6.0.36 distro
> following the instructions in the tomcat docs and copied
> /etc/init.d/tomcat6 (the old start/stop script) to
> /etc/init.d/tomcat. I modified the file to point to the new version and
> started the server
> /etc/init.d/tomcat has been pasted at http://pastebin.com/ihGDJb1C for your
> perusal should you wish.
>
> Actually Tomcat runs fine, it serves my site and carries a good load (200+
> sessions concurrently with no apparent degradation)
> there is no Apache front end, Tomcat runs standalone. The problem is with
> the logging
>
> /etc/init.d/tomcat has the following two lines
>
> -outfile $CATALINA_HOME/logs/catalina.out \
> -errfile $CATALINA_HOME/logs/catalina.err \
>
> And here's the problem. Most of the logging output ends up in catalina.err
> even though there are no errors in the logs
> occasionally a few lines from my application loggers end up in
> catalina.out. I also have logging.properties
> in WEB-INF/classes. This has been around ever since I deployed the first
> version of my app a couple of years ago
> and has always produced the expected output. Now I get nothing.
>
> The hosting companies preferred solution is to recompile tomcat 'for a one
> off fee' (I kid you not). I'm pretty sure that Tomcat doesn't need
> rebuilding to run under jsvc
> and if it does I'm quite capable of building it myself, so no help there
> then ...
>
> logging.properties reproduced below just FYI if you want it.
>
> Any advice on how I can get the logging working will be much appreciated
>
>
> Lyallex
>
>
>
> handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
>
> ############################################################
> # Handler specific properties.
> # Describes specific configuration info for Handlers.
> ############################################################
>
> org.apache.juli.FileHandler.level = ALL
> org.apache.juli.FileHandler.directory = ${catalina.base}/logs
> org.apache.juli.FileHandler.prefix = MyApp.
>
> java.util.logging.ConsoleHandler.level = ALL
> java.util.logging.ConsoleHandler.formatter =
> java.util.logging.SimpleFormatter
1. "java.util.logging.ConsoleHandler" prints to System.err.
Some other "console logging" implementations log to System.out.
Do you need a ConsoleHandler at all? (You are effectively printing the
same log messages into two places a) ConsoleHandler, b) FileHandler ).
2. To initialize logging properly you need to configure system
properties "java.util.logging.config.file" and
"java.util.logging.manager"
the same way as they are set by catalina.sh file.
Have you specified the "java.util.logging.manager" property in your
arguments to jsvc?
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org