Formato archivos log

ver /var/log/apache y configuración en httpd.conf:

# ErrorLog: The location of the error log file. If this does not start
# with /, ServerRoot is prepended to it.

ErrorLog /var/log/apache/error.log

Con ErrorLog especificamos la localización del fichero log de errores.

# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.

LogLevel warn

Con LogLevel controlamos el número de mensajes almacenados en el fichero log de errores. Para ello, debemos especificar un nivel mínimo de importancia de los mensajes. Por ejemplo, si especificamos LogLevel warn, tan solo se almacenarán mensajes de tipo warn, error, crit, alert y emerg.

# The following directives define some format nicknames for use with
# a CustomLog directive (see below).

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T
%v"
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
combin
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

Con LogFormat podemos especificar el formato que tendrá el archivo log. Este formato concreto es el que usa el Apache por defecto (ncsa), aunque es totalmente configurable.

# The location of the access logfile (Common Logfile Format).
# If this does not start with /, ServerRoot is prepended to it.

CustomLog /var/log/apache/access.log common

Con CustomLog especificamos la ruta donde se encuentra el archivo de log referente al acceso.Con CustomLog también podemos indicar una ruta para archivos de log específicos (agent y referer) si deseamos que existan:

# If you would like to have an agent and referer logfile uncomment the
# following directives.

#CustomLog /var/log/apache/referer.log referer
#CustomLog /var/log/apache/agent.log agent

Aunque también es posible combinar todos estos archivos de log en uno solo:

# If you prefer a single logfile with access, agent and referer information
# (Combined Logfile Format) you can use the following directive.

#CustomLog /var/log/apache/access.log combined
 

 [VOLVER]