Custom format
The XML-based custom log format is more flexible than the standard log file formats, giving you more control over the type of information in your log files. Create a custom log format if you need data for analysis that is not available in the standard formats. You can decide what information to record for each Content Gateway transaction and create filters to define which transactions to log.
The heart of the custom logging feature is an XML-based logging configuration file (logs_xml.config) that enables you to create modular descriptions of logging objects. The logs_xml.config file uses three types of objects to create custom log files:
- The LogFormat defines the content of the log file using printf-style format strings.
- The LogFilter defines a filter so that you include or exclude certain information from the log file.
- The LogObject specifies all the information needed to produce a log file. For example:
- The name of the log file (required).
- The format to be used (required). This can be a standard format (Squid or Netscape) or a previously defined custom format (a previously defined LogFormat object).
- The file mode (ASCII, Binary, or ASCII_PIPE). The default is ASCII.
The ASCII_PIPE mode writes log entries to a UNIX named pipe (a buffer in memory). Other processes can then read the data using standard I/O functions. The advantage of using this option is that Content Gateway does not have to write to disk, freeing disk space and bandwidth for other tasks.
Note: When the buffer is full, Content Gateway drops log entries and issues an error message indicating how many entries were dropped. Content Gateway writes only complete log entries to the pipe; therefore, only full records are dropped. - Any filters you want to use (previously defined LogFilter objects).
- The collation servers that are to receive the log files.
- The protocols you want to log (if the protocols tag is used, Content Gateway logs only transactions from the protocols listed; otherwise, all transactions for all protocols are logged).
- The origin servers you want to log (if the servers tag is used, Content Gateway logs only transactions for the origin servers listed; otherwise, transactions for all origin servers are logged).
- The header text you want the log files to contain. The header text appears at the beginning of the log file, just before the first record.
- The log file rolling options.Note: To generate a custom log format, you must specify at least one LogObject definition. One log file is produced for each LogObject definition. You can create a custom log format in the Content Gateway manager or by editing a configuration file.