PHP Error Log Parser
Parse PHP error log
Installation
$ npm install -save php-errorlog-parser
Usage
var Parser = ;var fs = ; var parser = 0;parser; var content = fs;content;
methods
constructor(threshold)
threshold
parameter: Wait time for accept continuous line input, in milli seconds.
threshold
stands for multi line parsing.
If a bunch of lines come within threashold
, the parser can parse them together.
addLine(line)
Add new line to the parser.
line
parameter: New line string.
The parser expect that line
has no CR
nor LF
in its tail.
events
record
Emitted when a parsed record is formed.
record
parameter: key | type | description |
---|---|---|
time |
Date | log timestamp |
level |
string | log level |
lines |
array | log lines |
stacktrace |
array/null | strace trace lines |
error
Emmited when an error occured
error
parameger: Error description.
License
MIT