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]
  → debug=level
  → request=level
  → result=level
  → error=level
  → context=level
  → packet=level
  → detail=level
Context Default Server
Example Trace request=1 error=2 result=2 context=3 packet=4 detail=5
Notes

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

  • debug — development debug events
  • request — core request events
  • response — core response events
  • errors — request errors
  • context — request processing information
  • packet — Low level packet information
  • verbose — Network level events

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. These records are emitted at the completion of the rest. The detail format writes multi-line records with full capture of request and response headers and other details that are emitted at various stages of the processing of the request.

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.