Skip to content

Logger types reference

pkorotkov edited this page Feb 12, 2012 · 4 revisions

Logger types are set in the top "seelog" element. The attribute name is "type".

Synchronous

Function: Processes log message in the same goroutine where the log func was called

Type attribute value: Sync

Additional attributes: None

Example:

<seelog type="sync">
    ...
</seelog>

Asynchronous loop

Function: processes log messages in a separate goroutine. Gets messages from the message queue in a 'for' loop.

Type attribute value: asyncloop (This is the default type, so you can just omit 'type' attribute)

Additional attributes: none

Example:

<seelog type="asyncloop">
    ...
</seelog>
<seelog>
    ...
</seelog>

Asynchronous timer

Function: processes log messages in a separate goroutine. Gets messages from the message queue with a specified time interval.

Type attribute value: asynctimer

Additional attributes:

  • asyncinterval - timer interval (in nanoseconds)

Example:

<seelog type="asynctimer" asyncinterval="5000">
    ...
</seelog>
Clone this wiki locally