Home > Users Guide > Configuration Directives > Logging Directives

Quick Nav

See Also

Logging Directives

AccessLog

Description Configure a request access log.
Synopsis AccessLog path
  → [size=bytes]
  → [backup=count]
  → [append]
  → [anew]
Context Default Server, Virtual Host, Route
Example AccessLog access.log size=1MB backup=5 append anew
Notes

The AccessLog directive configures an access log that Appweb uses to log completed HTTP requests for the current route. The given path may be an absolute filename or it may be relative to the Home directory. The AccessLog directive is inherited from outer routes in the config file.

The size parameter specifies a maximum size to write to a single log file. The backup parameter indicates how many backup log files to preserve. When the maximum size is exceeded, the log files will be renamed by appending a sequential number from zero up to the given path name. The highest number will be the oldest log file.

The append option means that new content will be appended to an existing log file, whereas, anew specifies that the log file will be created anew whenever Appweb is restarted.

ErrorLog

Description Configure the Appweb diagnostic error log
Synopsis ErrorLog path
  → [size=bytes]
  → [level=0-9]
  → [backup=count]
  → [append]
  → [anew]
  → [stamp=period]
Context Default Server
Example ErrorLog error.log size=1MB level=2 backup=5 append anew stamp=1hr
Notes

The ErrorLog directive configures the diagnostic error log for Appweb. There is one such error log and all error messages and trace will be written to this log.

The given path may be an absolute filename or it may be relative to the Home directory.

The size parameter specifies a maximum size to write to a single log file. The backup parameter indicates how many backup log files to preserve. When the maximum size is exceeded, the log files will be renamed by appending a sequential number from zero up to the given path name. The highest number will be the oldest log file.

The append option means that new content will be appended to an existing log file, whereas, anew specifies that the log file will be created anew whenever Appweb is restarted.

The level argument defines a logging verbosity level between 0 and 9 with 9 being the most verbose.

The following levels are generally observed:

Level Usage
0 Essential messages, fatal errors and critical warnings
1 Hard errors
2 Configuration setup and soft warnings
3 Useful informational messages
4 Debug information
5-9 Increasing levels of internal Appweb trace useful for debugging

If Appweb is invoked with a --log or --verbose argument, it will override the ErrorLog directive which will be ignored.

A general overview of using log files is discussed in the Administration section on Log Files.

The timestamp option controls how frequently time stamps are appended to the log file. Timestamps are useful to frame the time window in which log file events occurred.

Log

Description Control the tracing of HTTP messages
Synopsis Log [rx|tx]
  → conn=level
  → first=level
  → headers=level
  → body=level
  → limits=level
  → time=level
  → size=bytes
  → exclude=extensions
  → include=extensions
Context Default Server
Example Log rx conn=5 first=2 headers=3 body=5 limits=5 size=10K
  → exclude="jpg,gif,png,ico,css,js"
Notes

The Log directive controls how HTTP messages are traced to the log file. The following classes of information can be traces.

  • Conn — connection oriented events
  • First — first line of the HTTP header
  • Headers — full HTTP header
  • Body — HTTP body content
  • Limits — Resource limit validation
  • Time — Request elapsed time (tx only)

For each class, the level defines the log level at which tracing will occur.

When tracing is enabled for a HTTP message, the headers and/or body of the message will be written to the log file. Binary body content will be encoded into printable hex characters. Tracing will be limited to at most size bytes per request.

The include and exclude define a set of file extensions that will be included or excluded in the trace.

© Embedthis Software LLC, 2003-2013. All rights reserved. Embedthis, Appweb, ESP, Ejscript and Embedthis GoAhead are trademarks of Embedthis Software LLC.