PDA

View Full Version : Tomcat e livelli di log


kingv
09-06-2004, 13:56
qualcuno sa come fare per avere un log piu' dettagliato di tomcat?

de default gli unici eventi loggati sulla console sono di classe INFO, mentre a me interessano anche quelli di livello piu' basso.

idem per quanto riguarda i file nella directory logs

per quanto modifichi server.xml mettendo
verbosity="4" debug="9"

nella configurazione dei logger non cambia nulla :(


P.S. non sto parlando dei log delle mie applicazioni, ho un problema con un meccanismo interno di tomcat.

kingv
10-06-2004, 10:53
up ci sto perdendo la vita su 'sta cosa :cry:

cn73
10-06-2004, 11:07
Non so se può darti qualche spunto, ma su apache esistono diversi parametri per gestire le informazioni dei log:



# Enable the timestamp before the log message
# Syntax: log.timestamp=[true,false] (boolean)
# Default: true
log.timestamp=true

# Use the given string as a data format
# (see java.text.SimpleDateFormat for the list of options)
# Syntax: log.dateFormat=(String)
# Default: [dd/MM/yyyy HH:mm:ss:SSS zz]
log.dateFormat=[dd/MM/yyyy HH:mm:ss:SSS zz]

# Since all the messages logged are processed by a thread running with
# minimum priority, it's of vital importance that this thread gets a chance
# to run once in a while. If it doesn't, the log queue overflow occurs,
# usually resulting in the OutOfMemoryError.
#
# To prevent this from happening, two parameters are used: log.queue.maxage
# and log.queue.maxsize. The former defines the maximum time for the logged
# message to stay in the queue, the latter defines maximum number of
# messages in the queue.
#
# If one of those conditions becomes true (age > maxage || size > maxsize),
# the log message stating that fact is generated and the log queue is
# flushed in the separate thread.
#
# If you ever see such a message, either your system doesn't live up to its
# expectations or you have a runaway loop (probably, but not necessarily,
# generating a lot of log messages).
#
# WARNING: Default values are lousy, you probably want to tweak them and
# report the results back to the development team.

# Syntax: log.queue.maxage = [milliseconds]
# Default: 5000
log.queue.maxage = 5000

# Syntax: log.queue.maxsize = [integer]
# Default: 1000
log.queue.maxsize = 1000

# Enable/disable logging the channel name
# Default: false
# log.channel=false

# Enable/disable channels, each logging different actions.
# Syntax: log.channel.[channel name]=[true,false] (boolean)
# Default: false

# Info channel - quite a lot of informational messages
# hopefully you don't need them under normal circumstances
# log.channel.info=true

# Servlets exception, i.e. exception caught during
# servlet.service() processing are monitored here
# you probably want to have this one switched on
log.channel.servletException=true

# JServ exception, caught internally in jserv
# we suggest to leave it on
log.channel.jservException=true

# Warning channel, it catches all the important
# messages that don't cause JServ to stop, leave it on
log.channel.warning=true

# Servlet log
# All messages logged by servlets. Probably you want
# this one to be switched on.
log.channel.servletLog=true

# Critical errors
# Messages produced by critical events causing jserv to stop
log.channel.critical=true

# Debug channel
# Only for internal debugging purposes
log.channel.debug=true

Soprattutto quest'ultimo ha effetto...

kingv
10-06-2004, 11:21
cn73> in tomcat per ogni entry di configurazione nel server.xml c'e' la possibilità di specificare il livello di log ma anche se li ho messi tutti al massimo non vedo nessun risultato.

posto un estratto significativo del mio file di config:




<Engine name="Catalina" defaultHost="localhost" debug="9">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="catalina_log." suffix=".txt" timestamp="true" verbosity="4" debug="9" />
<Host name="localhost" debug="9" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="localhost_log." suffix=".txt" verbosity="4" debug="9" timestamp="true"/>

[...]

cn73
10-06-2004, 11:33
Si si lo so, era magari per farti accendere qualche lampadina...
mmm...sei su Unix? Hai i permessi giusti?

kingv
10-06-2004, 11:43
Originariamente inviato da cn73
Si si lo so, era magari per farti accendere qualche lampadina...
mmm...sei su Unix? Hai i permessi giusti?


no in questo istante sono su Uindov$

ho spremuto google all'inverosimile ma non ne vengo fuori :incazzed:

cn73
10-06-2004, 13:02
Tuoni e fulmini!!! Senti a propos di scleri...mi dai un occhio a 4 post più in giu il problema con zio TomGatto?

cn73
10-06-2004, 13:11
Bho lascia perdere....ho cambiato none alla dir è funzica...bha!

cn73
10-06-2004, 16:36
Sicuramente avrai letto questa pagina: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/logger.html

e questa:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/valve.html#Access Log Valve