Difference between revisions of "AdvLog"

From ESS-WIKI
Jump to: navigation, search
Line 20: Line 20:
 
         "files":  30,
 
         "files":  30,
 
         "limit":  10240,
 
         "limit":  10240,
         "number":  40,
+
         "number":  40
        "els":  {
 
            "level":  5,
 
            "information":  0,
 
            "server":  "127.0.0.1",
 
            "port":  9200
 
        }
 
 
     }
 
     }
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
 
*[path]: set log files path (default:./logs)
 
*[path]: set log files path (default:./logs)
*[limit]: set file max size (unit: byte)(default:102400)
+
*[files]: set the max existing file number of all the files in the log path (a.k.a amount) (default:100, min:30, max:200)
*[static/dynamic]: static is the settings group of write to log file. dynamic is the group of display on console.
+
*[limit]: set the max rolling threshold byte of this process -------------- (unit: byte)   (default:102400, min:10240)
*[level]: Set log level (default:5)(<span style="color:#FF0000;">negative means gray mode aka text mode</span>),
+
*[number]: set the max rolling file number of this process ---------------- (a.k.a count)  (default:2, min:2, max:20)
 +
*[static/dynamic]: "static" means&nbsp;the settings of writing&nbsp;to log file. "dynamic" means the setting&nbsp;of display on console.
 +
*[level]: Set log level (default:5)('''<span style="color:#FF0000;">negative means gray mode in dynamic and&nbsp; text mode in static</span>'''),
  
 
::1:Fatal
 
::1:Fatal

Revision as of 09:43, 1 October 2018

Introduction

Architecture

C functions

Config File Format

Config file is in JSON Format:

{
    "default":  {
        "static":  {
            "level":  5,
            "information":  1
        },
        "dynamic":  {
            "level":  5,
            "information":  0,
            "hide":  ""
        },
        "path":  "./logs",
        "files":  30,
        "limit":  10240,
        "number":  40
    }
}
  • [path]: set log files path (default:./logs)
  • [files]: set the max existing file number of all the files in the log path (a.k.a amount) (default:100, min:30, max:200)
  • [limit]: set the max rolling threshold byte of this process -------------- (unit: byte) (default:102400, min:10240)
  • [number]: set the max rolling file number of this process ---------------- (a.k.a count) (default:2, min:2, max:20)
  • [static/dynamic]: "static" means the settings of writing to log file. "dynamic" means the setting of display on console.
  • [level]: Set log level (default:5)(negative means gray mode in dynamic and  text mode in static),
1:Fatal
2:Error
3:Warning
4:Notice
5:Info(Normal)
7:Debug
  • [information]: Enable DYNAMIC/STATIC Flag(default:0)
0: No timestamp;
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>

and showed on browser as below.

Output sample