Logging Directives

ErrorLog

Description Configure the Appweb diagnostic error log
Synopsis ErrorLog path
  → [size=bytes]
  → [level=0-5]
  → [backup=count]
  → [anew]
  → [stamp=period]
Context Default Server
Example ErrorLog error.log size=1MB level=2 backup=5 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 anew keyword specifies that a new log file will be created whenever Appweb is restarted.

The level argument defines a logging verbosity level between 0 and 5 with 5 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 Most verbose level of logging

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.

Trace

Description Control the tracing of HTTP requests
Synopsis Trace [rx|tx]
  → connection=level
  → errors=level
  → info=level
  → rxFirst=level
  → rxHeaders=level
  → rxBody=level
  → txFirst=level
  → txHeaders=level
  → txBody=level
  → complete=level
  → content=bytes
Context Default Server
Example Trace errors=2 rxFirst=2 rxHeaders=3 txFirst=3 txHeaders=3 connection=4
  → info=4 rxBody=5 txBody=5 complete=4 content=10K
Notes

The Trace directive controls how HTTP requests are traced to the request log file. The following classes of information can be traces.

  • connection — connection oriented events
  • errors — request errors resulting in abnormal termination
  • info — request processing information
  • rxFirst — first line of the HTTP request header
  • rxHeaders — full request headers
  • rxBody — request body content
  • txFirst — first line of the HTTP response header
  • txHeaders — full response headers
  • txBody — response body content
  • complete — Request completion

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 content bytes per request. Content size defaults to 40K.

TraceLog

Description Configure a request trace log.
Synopsis TraceLog path
  → [anew]
  → [backup=count]
  → [formatter=common|detail]
  → [level=0-5]
  → [size=bytes]
  → [stamp=period]
Context Default Server, Virtual Host, Route
Example TraceLog request.log size=1MB backup=5 anew
Notes

The TraceLog directive configures a request trace log that Appweb uses to write request trace information. The given path may be an absolute filename or it may be relative to the Home directory. The TraceLog directive applies per route and is inherited by default from outer routes in the config file.

Two output formats are available. The common formatter writes single-line records in the Common Log standard format. The detail format writes multi-line records with full capture of request and response headers and other details.

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 anew keyword specifies that a new log file will be created whenever Appweb is restarted.

© Embedthis Software. All rights reserved.