Difference between revisions of "AdvLog"
From ESS-WIKI
(→Output Format) |
|||
Line 2: | Line 2: | ||
==Architecture== | ==Architecture== | ||
==C functions== | ==C functions== | ||
− | ==Config File Format== | + | == Config File Format == |
+ | |||
Config file is in JSON Format: | Config file is in JSON Format: | ||
− | < | + | <syntaxhighlight lang="c"> |
{ | { | ||
"default": { | "default": { | ||
Line 20: | Line 21: | ||
} | } | ||
} | } | ||
− | </ | + | </syntaxhighlight> |
*[path]: set log files path (default:./logs) | *[path]: set log files path (default:./logs) | ||
*[limit]: set file max size (unit: byte)(default:102400) | *[limit]: set file max size (unit: byte)(default:102400) | ||
*[static/dynamic]: static is the settings group of write to log file. dynamic is the group of display on console. | *[static/dynamic]: static is the settings group of write to log file. dynamic is the group of display on console. | ||
− | *[level]: Set log level (default:5)(negative means gray mode), | + | *[level]: Set log level (default:5)(negative means gray mode), |
+ | |||
::1:Fatal | ::1:Fatal | ||
::2:Error | ::2:Error | ||
Line 31: | Line 33: | ||
::5:Info(Normal) | ::5:Info(Normal) | ||
::7:Debug | ::7:Debug | ||
+ | |||
*[information]: Enable DYNAMIC/STATIC Flag(default:0) | *[information]: Enable DYNAMIC/STATIC Flag(default:0) | ||
− | ::0: | + | |
− | ::1: | + | ::0: No timestam; |
+ | ::1: Add timestamp | ||
+ | |||
*[hide]:Hide DYNAMIC message (default:"", example:"1,3,5" to hide level 1, 3 and 5 message) | *[hide]:Hide DYNAMIC message (default:"", example:"1,3,5" to hide level 1, 3 and 5 message) | ||
− | + | ||
==Output Log Format== | ==Output Log Format== | ||
Default output format is html file: | Default output format is html file: |
Revision as of 07:38, 24 July 2017
Introduction
Architecture
C functions
Config File Format
Config file is in JSON Format:
{
"default": {
"path": "./logs",
"limit": 102400,
"static": {
"level": 5,
"information": 1
},
"dynamic": {
"level": 5,
"information": 0,
"hide": ""
}
}
}
- [path]: set log files path (default:./logs)
- [limit]: set file max size (unit: byte)(default:102400)
- [static/dynamic]: static is the settings group of write to log file. dynamic is the group of display on console.
- [level]: Set log level (default:5)(negative means gray mode),
- 1:Fatal
- 2:Error
- 3:Warning
- 4:Notice
- 5:Info(Normal)
- 7:Debug
- [information]: Enable DYNAMIC/STATIC Flag(default:0)
- 0: No timestam;
- 1: Add timestamp
- [hide]:Hide DYNAMIC message (default:"", example:"1,3,5" to hide level 1, 3 and 5 message)
Output Log Format
Default output format is html file:
<!DOCTYPE html><html><head><style type="text/css">body{color:white;background-color:black}log{display:block;}red>script{color:red;background-color:black}red{color:red;background-color:black}green>script{color:green;background-color:black}green{color:green;background-color:black}yellow>script{color:yellow;background-color:black}yellow{color:yellow;background-color:black}blue>script{color:#1569C7;background-color:black}blue{color:#1569C7;background-color:black}purple>script{color:purple;background-color:black}purple{color:purple;background-color:black}cyan>script{color:cyan;background-color:black}cyan{color:cyan;background-color:black}gray{color:#1C1C1C;background-color:black}redbg>script{color:white;background-color:red}redbg{color:white;background-color:red}greenbg>script{color:white;background-color:green}greenbg{color:white;background-color:green}yellowbg>script{color:black;background-color:yellow}yellowbg{color:black;background-color:yellow}bluebg>script{color:white;background-color:blue}bluebg{color:white;background-color:blue}purplebg>script{color:white;background-color:purple}purplebg{color:white;background-color:purple}cyanbg>script{color:black;background-color:cyan}cyanbg{color:black;background-color:cyan}whitebg>script{color:black;background-color:white}whitebg{color:black;background-color:white}script{display:block;}</style></head><body><pre><log><code> general> Initialize
</code><gray> [2016/06/29 16:27:42] [INFO] (.\SAGeneralHandler.c,General_Initialize,327)</gray>
</log><log><script type="text/plain"> general>Recv Topic [/cagent/admin/0000000BAB4231C8/agentcallbackreq] Data {"susiCommData":{"commCmd":2051,"requestID":0,"agentID":"","handlerName":"general","sendTS":1467188865}}
</script><gray> [2016/06/29 16:27:45] [INFO] (.\SAGeneralHandler.c,General_HandleRecv,372)</gray>
</log><log><script type="text/plain"> general>Recv Topic [/cagent/admin/0000000BAB4231C8/agentcallbackreq] Data {"susiCommData":{"requestItems":{},"commCmd":2056,"requestID":0,"agentID":"","handlerName":"general","sendTS":1467188865}}
</script><gray> [2016/06/29 16:27:45] [INFO] (.\SAGeneralHandler.c,General_HandleRecv,372)</gray>
</log></pre></body></html>