-
Notifications
You must be signed in to change notification settings - Fork 241
Predefined formats
Seelog configuration parser recognizes a set of special format identifiers, known as predefined formats. These identifiers were introduced to avoid creating common formats like 'xml' or 'json' every time explicitly in a configuration file.
Use one of the predefined format identifiers in 'formatid' attribute of any output node. Predefined ids can be distinguished by a common prefix std:. The full list of ids is given below.
Note: It is absolutely legal to override predefined formats with your own and to create your own formats with identifiers starting with std:, but both practices are not recommended.
<seelog>
<outputs formatid="std:json">
<console/>
</outputs>
</seelog>seelog.Info("Hello world!"):
{"time":1341218159882230900,"lev":"Inf","msg":"Hello world!"}
Full name of a format identifier consists of the prefix std: and one of the identifiers listed below. Here is a full list of id-format pairs:
-
xml-debug:
<time>%Ns</time><lev>%Lev</lev><msg>%Msg</msg><path>%RelFile</path><func>%Func</func> -
xml-debug-short:
<t>%Ns</t><l>%l</l><m>%Msg</m><p>%RelFile</p><f>%Func</f> -
xml:
<time>%Ns</time><lev>%Lev</lev><msg>%Msg</msg> -
xml-short:
<t>%Ns</t><l>%l</l><m>%Msg</m> -
json-debug:
{"time":%Ns,"lev":"%Lev","msg":"%Msg","path":"%RelFile","func":"%Func"} -
json-debug-short:
{"t":%Ns,"l":"%Lev","m":"%Msg","p":"%RelFile","f":"%Func"} -
json:
{"time":%Ns,"lev":"%Lev","msg":"%Msg"} -
json-short:
{"t":%Ns,"l":"%Lev","m":"%Msg"} -
debug:
[%LEVEL] %RelFile:%Func %Date %Time %Msg%n -
debug-short:
[%LEVEL] %Date %Time %Msg%n -
fast:
%Ns %l %Msg%n