Server Log

Table of Contents

Server Log

File Name | Log Level | Debug Level | Rolling Size (bytes) | Keep Days | Enable stderr Log

Access Log

File Name | Piped Logger | Log Format | Log Headers | Rolling Size (bytes) | Keep Days | Compress Archive

File Name

Description

Specifies the path for the log file.

Syntax

Filename which can be an absolute path or a relative path to $SERVER_ROOT.

Tips

Place the log file on a separate disk.

Log Level

Description

Specifies the level of logging to include in your log file. Available levels (from high to low) are: ERROR, WARNING, NOTICE, INFO and DEBUG. Only messages with level higher or equal to the current setting will be logged.

Syntax

Select from drop down list

Tips

Using DEBUG log level does not have any performance impact, unless Debug Level is set to a level other than NONE. It's recommended to set Log Level to DEBUG and Debug Level to NONE. These settings mean that you will not fill up your hard disk with debug logging, but you will be able to use the Toggle Debug Logging action to control debug output. This action can turn debug logging on and off on the fly, and is useful for debugging busy production servers.

See Also

Debug Level

Debug Level

Description

Specifies the level of debug logging. Log Level must be set to DEBUG to use this feature. Debug logging is disabled when "Debug Level" is set to NONE even if Log Level is set to DEBUG. Toggle Debug Logging can be used to control debug level on a live server without restarting.

Syntax

Select from drop down list

Tips

Important! Always set this to NONE if you do not need detailed debug logging. Active debug logging will severely degrade service performance and potentially saturate disk space in a very short time. Debug logging includes detailed information for each request and response.

It's recommended to set Log Level to DEBUG and Debug Level to NONE. These settings mean that you will not fill up your hard disk with debug logging, but you will be able to use the Toggle Debug Logging action to control debug output. This action can turn debug logging on and off on the fly, and is useful for debugging busy production servers.

See Also

Log Level, Toggle Debug Logging

Rolling Size (bytes)

Description

Specifies when the current log file needs to be rolled over, also known as log rotation. When the file size is over the rollover limit, the active log file will be renamed to log_name.mm_dd_yyyy(.sequence) in the same directory and a new active log file will be created. The actual size of the rotated log file once it is created will sometimes be a little bigger than this size limit. Set to 0 to disable log rotation.

Syntax

Integer number

Tips

Append "K", "M", "G" to the number for kilo-, mega- and giga- bytes.

Keep Days

Description

Specifies how many days the access log file will be kept on disk. Only rotated log files older than the specified number of days will be deleted. The current log file will not be touched regardless how many days worth of data it contains. If you do not want to auto-delete stale and very old log files, set this to 0.

Syntax

Integer number

Enable stderr Log

Description

Specifies whether to write to log when receiving stderr output from processes started by the server.

If enabled, stderr messages will be logged in the same directory as the server log with the fixed name "stderr.log". If disabled, all stderr output will be discarded.

Functions like PHP's error_log() which do not write directly to stderr (file handle 2) are not affected by this setting and will write to the file set in PHP ini directive 'error_log' or the server's "error.log" file with tag '[STDERR]' if that directive is not set.

Syntax

Select from radio box

Tips

Turn it on if you need to debug configured external applications: i.e. PHP, Ruby, Java, Python, Perl.

File Name

Description

The access log filename.

Syntax

Filename which can be an absolute path or a relative path to $SERVER_ROOT.

Tips

Put access log file on a separate disk.

Piped Logger

Description

Specifies the external application that will receive the access log data sent by LiteSpeed through a pipe on its STDIN stream (file handle is 0). When this field is specified, the access log will be sent only to the logger application and not the access log file specified in previous entry.

The logger application must be defined in External Apps section first. Server-level access logging can only use an external logger application defined at the server level. Virtual host-level access logging can only use a logger application defined at the virtual host level.

The logger process is spawned in the same way as other external (CGI/FastCGI/LSAPI) processes. This means it will execute as the user ID specified in the virtual host's External App Set UID Mode settings and will never run on behalf of a privileged user.

LiteSpeed web server performs simple load balancing among multiple logger applications if more than one instance of a logger application is configured. LiteSpeed server always attempts to keep the number of logger applications as low as possible. Only when one logger application fails to process access log entries in time will the server attempt to spawn another instance of the logger application.

If a logger crashes, the web server will start another instance but the log data in the stream buffer will be lost. It is possible to lose log data if external loggers cannot keep up with the speed and volume of the log stream.

Syntax

Select from drop down list

Log Format

Description

Specifies the log format for the access log. When log format is set, it will override the Log Headers setting.

Syntax

String. The syntax of log format is compatible with Apache 2.0's custom log format.

Example

Common Log Format (CLF)
"%h %l %u %t \"%r\" %>s %b"

Common Log Format with Virtual Host
"%v %h %l %u %t \"%r\" %>s %b"

NCSA extended/combined log format
"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"

Log cookie value of Foobar
"%{Foobar}C"

See Also

Log Headers

Log Headers

Description

Specifies whether to log HTTP request headers: Referer, UserAgent, and Host.

Syntax

Select from checkbox

Tips

Turn this off if you do not need these headers in the access log.

See Also

Log Format

Compress Archive

Description

Specifies whether to compress rotated log files in order to save disk space.

Syntax

Select from radio box

Tips

Log files are highly compressible and this is recommended to reduce disk usage for old logs.