Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-20 Thread André Warnier

Konstantin Kolinko wrote:

2010/4/20 André Warnier a...@ice-sa.com:

I suggest a simple way whereby to tell Tomcat (optionally) just /not/ to
rotate its logfiles itself, and to always write to a fixed filename.
(an additional property in logging.properties ?)
There exists under Linux the logrotate utility, which is perfect for that
kind of thing.  And with Apache (Unix and Windows) is supplied the
rotatelogs utility, which can be used with a pipe to much the same effect.
Not much to do at the Tomcat level, and much simplification at the sysadmin
level.



If you do not want the rotation, that is already available.

Just use a
http://java.sun.com/javase/6/docs/api/java/util/logging/FileHandler.html

Thank you Konstantin, that is helpful to know (and not so evident for 
dummies).
But could you indicate where exactly this has to be set in the standard 
vanilla Tomcat logging.properties file (or elsewhere) to achieve the 
not rotate aspect ?

Once I know (and try), I will add an article to the FAQ/Wiki to that effect.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-20 Thread Konstantin Kolinko
2010/4/21 André Warnier a...@ice-sa.com:
 But could you indicate where exactly this has to be set in the standard
 vanilla Tomcat logging.properties file (or elsewhere) to achieve the not
 rotate aspect ?

It is just another implementation of java.util.logging.Handler, like
the ConsoleHandler that is already present in logging.properties.
IIRC, it should correctly work with property name prefixes used in
JULI logging.properties file, though I do not have an example at hand.

The example of ConsoleHandler there suggests that the prefixes can be
omitted, when you have a single instance of the handler class.

Note though, that
a) the package name is different, so the property names will be different
b) the set of properties is different from the ones in Tomcat JULI
implementation of FileHandler.

E.g., there is java.util.logging.FileHandler.pattern property. See
the JavaDoc that I mentioned for details.

http://java.sun.com/javase/6/docs/api/java/util/logging/FileHandler.html

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread laredotornado

Hi,

I'm using Tomcat 6.0.26 on Mac 10.6.3.  Currently, in my $CATALINA_HOME/logs
directory, Tomcat produces a localhost*log file with the date in the file
name for each day, for example -- localhost.2010-04-19.  Is there a way to
get Tomcat to generate simply localhost.log for whatever day today is?  If
not, does anyone know a shell short cut where I can just type in something
like vim ~/localhost.log and see the most current log without having to
specify today's date?

Thanks, - Dave
-- 
View this message in context: 
http://old.nabble.com/Way-to-generate-a-%22localhost.log%22-instead-of-%22localhost-4-20-2010.log%22--tp28287685p28287685.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Peter Crowther
Hmm.  As the log files will alpha-sort by date, something like vim `ls
~/localhost.log* | tail -1` might do it.  Beware - my shell script is rusty
at best.

- Peter

On 19 April 2010 15:29, laredotornado laredotorn...@gmail.com wrote:


 Hi,

 I'm using Tomcat 6.0.26 on Mac 10.6.3.  Currently, in my
 $CATALINA_HOME/logs
 directory, Tomcat produces a localhost*log file with the date in the file
 name for each day, for example -- localhost.2010-04-19.  Is there a way to
 get Tomcat to generate simply localhost.log for whatever day today is?
  If
 not, does anyone know a shell short cut where I can just type in something
 like vim ~/localhost.log and see the most current log without having to
 specify today's date?

 Thanks, - Dave
 --
 View this message in context:
 http://old.nabble.com/Way-to-generate-a-%22localhost.log%22-instead-of-%22localhost-4-20-2010.log%22--tp28287685p28287685.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Pid
On 19/04/2010 15:29, laredotornado wrote:
 
 Hi,
 
 I'm using Tomcat 6.0.26 on Mac 10.6.3.  Currently, in my $CATALINA_HOME/logs
 directory, Tomcat produces a localhost*log file with the date in the file
 name for each day, for example -- localhost.2010-04-19.  Is there a way to
 get Tomcat to generate simply localhost.log for whatever day today is?  If
 not, does anyone know a shell short cut where I can just type in something
 like vim ~/localhost.log and see the most current log without having to
 specify today's date?

You know about using the tab key in shell?
Not being bothered to fill in the right filename seems a bit lame.


p




signature.asc
Description: OpenPGP digital signature


Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Jon Brisbin

On Apr 19, 2010, at 3:42 PM, Pid wrote:

 On 19/04/2010 15:29, laredotornado wrote:
 
 Hi,
 
 I'm using Tomcat 6.0.26 on Mac 10.6.3.  Currently, in my $CATALINA_HOME/logs
 directory, Tomcat produces a localhost*log file with the date in the file
 name for each day, for example -- localhost.2010-04-19.  Is there a way to
 get Tomcat to generate simply localhost.log for whatever day today is?  If
 not, does anyone know a shell short cut where I can just type in something
 like vim ~/localhost.log and see the most current log without having to
 specify today's date?
 
 You know about using the tab key in shell?
 Not being bothered to fill in the right filename seems a bit lame.
 

I'm often frustrated by this convention as well. I end up having to hit tab 
multiple times because there are several months and many days of log files in 
these directories. Those keystrokes add up and it's often no faster to use tab 
than it is to just type the full filename. If, on the other hand, one could 
type less loTAB/loTAB, I could work faster and more efficiently.

I don't find this question insignificant at all. I'd like to know the answer 
myself.

Jon Brisbin
Portal Webmaster
NPC International, Inc.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread André Warnier

Pid wrote:

On 19/04/2010 15:29, laredotornado wrote:

Hi,

I'm using Tomcat 6.0.26 on Mac 10.6.3.  Currently, in my $CATALINA_HOME/logs
directory, Tomcat produces a localhost*log file with the date in the file
name for each day, for example -- localhost.2010-04-19.  Is there a way to
get Tomcat to generate simply localhost.log for whatever day today is?  If
not, does anyone know a shell short cut where I can just type in something
like vim ~/localhost.log and see the most current log without having to
specify today's date?


You know about using the tab key in shell?
Not being bothered to fill in the right filename seems a bit lame.


I disagree.
The point raised by the OP above is one that bothers a lot of people.
The lame bit is the way in which standard out-of-the-box Tomcat 
generates its logfiles, and their rotation, inflexibly.
And yes, I know one can implement log4j and do whatever one wants, but 
for a large number of Tomcat occasional users and admins, that's too 
much to ask.
I am not trying to start a flame, and I like Tomcat in general, and I 
try to contribute to the limits of my limited abilities.  I am just 
pointing out one area in which, in my view, Tomcat is a bit deficient 
for people who cannot spent much of their time on one particular 
server-type software.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Mark Thomas
On 19/04/2010 22:32, André Warnier wrote:
 I disagree.
 The point raised by the OP above is one that bothers a lot of people.
 The lame bit is the way in which standard out-of-the-box Tomcat
 generates its logfiles, and their rotation, inflexibly.
 And yes, I know one can implement log4j and do whatever one wants, but
 for a large number of Tomcat occasional users and admins, that's too
 much to ask.
 I am not trying to start a flame, and I like Tomcat in general, and I
 try to contribute to the limits of my limited abilities.  I am just
 pointing out one area in which, in my view, Tomcat is a bit deficient
 for people who cannot spent much of their time on one particular
 server-type software.

So I can expect to see an enhancement request with some clear
requirements that go beyond the current implementation is lame in
bugzilla some time soon?

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread André Warnier

Mark Thomas wrote:

On 19/04/2010 22:32, André Warnier wrote:

I disagree.
The point raised by the OP above is one that bothers a lot of people.
The lame bit is the way in which standard out-of-the-box Tomcat
generates its logfiles, and their rotation, inflexibly.
And yes, I know one can implement log4j and do whatever one wants, but
for a large number of Tomcat occasional users and admins, that's too
much to ask.
I am not trying to start a flame, and I like Tomcat in general, and I
try to contribute to the limits of my limited abilities.  I am just
pointing out one area in which, in my view, Tomcat is a bit deficient
for people who cannot spent much of their time on one particular
server-type software.


So I can expect to see an enhancement request with some clear
requirements that go beyond the current implementation is lame in
bugzilla some time soon?


Allright.
How about collecting some suggestions before on this list ?

I suggest a simple way whereby to tell Tomcat (optionally) just /not/ to 
rotate its logfiles itself, and to always write to a fixed filename.

(an additional property in logging.properties ?)
There exists under Linux the logrotate utility, which is perfect for 
that kind of thing.  And with Apache (Unix and Windows) is supplied the 
rotatelogs utility, which can be used with a pipe to much the same effect.
Not much to do at the Tomcat level, and much simplification at the 
sysadmin level.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Pid
On 19/04/2010 23:11, André Warnier wrote:
 Mark Thomas wrote:
 On 19/04/2010 22:32, André Warnier wrote:
 I disagree.

Fair enough.

 The point raised by the OP above is one that bothers a lot of people.

I don't like juli logging at all, but hitting tab  a couple of keys
isn't that traumatic.  Really.

 The lame bit is the way in which standard out-of-the-box Tomcat
 generates its logfiles, and their rotation, inflexibly.

Patching the FileHandler doesn't look so tricky, so if you can generate
some consensus, or ideas about whether you just want to turn it off or
configure rotatable pattern characteristics, I'll take a crack at it.


p

 And yes, I know one can implement log4j and do whatever one wants, but
 for a large number of Tomcat occasional users and admins, that's too
 much to ask.
 I am not trying to start a flame, and I like Tomcat in general, and I
 try to contribute to the limits of my limited abilities.  I am just
 pointing out one area in which, in my view, Tomcat is a bit deficient
 for people who cannot spent much of their time on one particular
 server-type software.

 So I can expect to see an enhancement request with some clear
 requirements that go beyond the current implementation is lame in
 bugzilla some time soon?

 Allright.
 How about collecting some suggestions before on this list ?
 
 I suggest a simple way whereby to tell Tomcat (optionally) just /not/ to
 rotate its logfiles itself, and to always write to a fixed filename.
 (an additional property in logging.properties ?)
 There exists under Linux the logrotate utility, which is perfect for
 that kind of thing.  And with Apache (Unix and Windows) is supplied the
 rotatelogs utility, which can be used with a pipe to much the same effect.
 Not much to do at the Tomcat level, and much simplification at the
 sysadmin level.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Konstantin Kolinko
2010/4/20 André Warnier a...@ice-sa.com:

 I suggest a simple way whereby to tell Tomcat (optionally) just /not/ to
 rotate its logfiles itself, and to always write to a fixed filename.
 (an additional property in logging.properties ?)
 There exists under Linux the logrotate utility, which is perfect for that
 kind of thing.  And with Apache (Unix and Windows) is supplied the
 rotatelogs utility, which can be used with a pipe to much the same effect.
 Not much to do at the Tomcat level, and much simplification at the sysadmin
 level.


If you do not want the rotation, that is already available.

Just use a
http://java.sun.com/javase/6/docs/api/java/util/logging/FileHandler.html


Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Terence M. Bandoian

Here's a Linux script to remove log files older than seven days:

   find /var/tomcat5/logs -daystart -mtime +7 -type f -exec rm '{}' \;

Just in case anyone might find it useful.

-Terence Bandoian

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org