Runtime Configuration

The behaviour of these functions is affected by settings in php.ini.

Seaslog Configure Options
NameDefaultChangeableChangelog
seaslog.appender1INI_SYSTEM
seaslog.appender_retry0INI_ALL
seaslog.level8INI_ALL
seaslog.remote_host127.0.0.1INI_ALL
seaslog.remote_port514INI_ALL
seaslog.remote_timeout1INI_SYSTEM
seaslog.default_basepath/var/log/wwwINI_SYSTEM
seaslog.default_loggerdefaultINI_SYSTEM
seaslog.default_template%T | %L | %P | %Q | %t | %MINI_SYSTEM
seaslog.default_datetime_formatY-m-d H:i:sINI_SYSTEM
seaslog.trace_error1INI_ALL
seaslog.trace_exception0INI_SYSTEM
seaslog.trace_notice0INI_ALL
seaslog.trace_warning0INI_ALL
seaslog.use_buffer0INI_SYSTEM
seaslog.buffer_size0INI_ALL
seaslog.buffer_disabled_in_cli0INI_SYSTEM
seaslog.disting_type0INI_SYSTEM
seaslog.disting_folder1INI_SYSTEM
seaslog.disting_by_hour0INI_SYSTEM
seaslog.recall_depth0INI_ALL
seaslog.trim_wrap0INI_ALL
seaslog.ignore_warning1INI_ALL
seaslog.throw_exception1INI_ALL

Here's a short explanation of the configuration directives.

seaslog.appenderint

Switch the Record Log Data Store. 1File 2TCP 3UDP (Switch default 1)

SeasLog will send log to tcp://remote_host:remote_port or udp://remote_host:remote_port server, when seaslog.appender configured to 2 (TCP) or 3 (UDP).

When SeasLog send log to TCP/UDP,style follow RFC5424. The {logInfo} affected by seaslog.default_template.

 The log style finally formatted such as: <15>1 2017-08-27T01:24:59+08:00 vagrant-ubuntu-trusty test/logger[27171]: 2016-06-25 00:59:43 | DEBUG | 21423 | 599157af4e937 | 1466787583.322 | this is a neeke debug <14>1 2017-08-27T01:24:59+08:00 vagrant-ubuntu-trusty test/logger[27171]: 2016-06-25 00:59:43 | INFO | 21423 | 599157af4e937 | 1466787583.323 | this is a info log <13>1 2017-08-27T01:24:59+08:00 vagrant-ubuntu-trusty test/logger[27171]: 2016-06-25 00:59:43 | NOTICE | 21423 | 599157af4e937 | 1466787583.324 | this is a notice log 
seaslog.appender_retryint

Record Log Retry Count. Default 0 (Do Not Retry)

seaslog.buffer_disabled_in_cliint

Disable buffer in cli. 1-Y 0-N(Default)

Switch the configure buffer_disabled_in_cli on. The buffer_disabled_in_cli switch default off. If switch buffer_disabled_in_cli on, and running in cli, seaslog.use_buffer setting will be discarded, Seaslog write to the Data Store IMMEDIATELY.

seaslog.buffer_sizeint

Configure the buffer_size with 100. The buffer_size default 0, it’s meaning don’t use buffer. If buffer_size > 0,SeasLog will rewritten down into the Data Store when the prerecorded log in memory count >= this buffer_size,and then refresh the memory poll.

seaslog.default_basepathstring

Default Log Base Path. Defult "/var/log/www".

seaslog.default_datetime_formatstring

The DateTime Style. Default "Y-m-d H:i:s".

seaslog.default_loggerstring

Default Logger Path. Default "default".

seaslog.disting_by_hourint

Switch use the logger with hour. 1-Y 0-N(Default)

Note:

seaslog.disting_by_hour = 1 Switch use Logger DisTing by hour. It’s meaning SeasLog will create the file each one hour.

seaslog.disting_folderint

Switch use the logger with folder. 1-Y(Default) 0-N

Note:

seaslog.disting_folder = 1 Switch use Logger DisTing by folder, it’s meaning SeasLog will create the file deistic by folder, and when this configure close SeasLog will create file use underline connect Logger and Time like default_20180211.log.

seaslog.disting_typeint

Switch use the logger with type. 1-Y 0-N(Default)

Note:

seaslog.disting_type = 1 Switch use Logger DisTing by type, it’s meaning SeasLog will create the file deistic info\warn\error and the other type.

seaslog.ignore_warningint

Switch ignore SeasLog warning. 1-On(Default) 0-Off

Note:

seaslog.ignore_warning = 1 Open a warning to ignore SeasLog itself. When directory permissions or receive server ports are blocked, they are ignored; when closed, a warning is thrown.

seaslog.levelint

Record logger level. Default 8 (All of them). 0-EMERGENCY 1-ALERT 2-CRITICAL 3-ERROR 4-WARNING 5-NOTICE 6-INFO 7-DEBUG 8-ALL

Note:

Tips: The configuration item has changed since the 1.7.0 version. Before the 1.7.0 version, the smaller the value, the more logs are taken according to the level: 0-all 1-debug 2-info 3-notice 4-warning 5-error 6-critical 7-alert 8-emergency Before the 1.7.0 version, Default 0 (All of them).

seaslog.recall_depthint

Log function recall depth.Will affected variable LineNo in %F. Default 0

seaslog.remote_hoststring

If you use Record TCP or UDP, configure this remote ip. Default "127.0.0.1"

seaslog.remote_portint

If you use Record TCP or UDP, configure this remote port. Default 514

seaslog.remote_timeoutint

If you use Record TCP or UDP, configure this remote timeout. Default 1 second

seaslog.throw_exceptionint

Switch throw SeasLog exception. 1-On(Default) 0-Off

Note:

seaslog.throw_exception = 1 Open an exception that throws the SeasLog to throw itself. When the directory authority or the receive server port is blocked, throw an exception; do not throw an exception when closed.

seaslog.trace_errorint

Automatic Record final error with default logger. 1-Y(Default) 0-N

seaslog.trace_exceptionint

Automatic Record exception with default logger. 1-Y 0-N(Default)

seaslog.trace_noticeint

Automatic Record notice with default logger. 1-Y 0-N(Default)

seaslog.trace_warningint

Automatic Record warning with default logger. 1-Y 0-N(Default)

seaslog.trim_wrapint

Trim the \n and \r in log message. 1-On 0-Off(Default)

seaslog.use_bufferint

Switch use the log buffer with memory. 1-Y 0-N(Default)

Note:

seaslog.use_buffer = 1 Switch the configure use_buffer on. The use_buffer switch default off. If switch use_buffer on, SeasLog prerecord the log with memory, and them would be rewritten down into the Data Store by request shutdown or php process exit (PHP RSHUTDOWN or PHP MSHUTDOWN).

seaslog.default_templatestring

Default Log template. Default "%T | %L | %P | %Q | %t | %M".

Note:

The following default variables are provided, which can be used directly in the log template and replaced as a corresponding value when the log is eventually generated.

Default log template is: seaslog.default_template = "%T | %L | %P | %Q | %t | %M", that's mean,default log style is: {dateTime} | {level} | {pid} | {uniqid} | {timeStamp} | {logInfo}

If you custom log template, such as: seaslog.default_template = "[%T]:%L %P %Q %t %M", that's will mean,log style was custom as: [{dateTime}]:{level} {pid} {uniqid} {timeStamp} {logInfo}

Seaslog Default Variable Table
Variable NameDescription
%LLevel.
%MMessage.
%TDateTime. Such as 2017-08-16 19:15:02, affected by seaslog.default_datetime_format.
%tTimestamp. Such as 1502882102.862,accurate to milliseconds.
%QRequestId. To distinguish a single request, such as not invoking the SeasLog::setRequestId($string) function, the unique value generated by the built-in static char *get_uniqid () function is used when the request is initialized.
%HHostName.
%PProcessId.
%DDomain:Port. Such as www.cloudwise.com:80; When Cli, Such as cli.
%RRequest URI. Such as /app/user/signin; When Cli it's the index script, Such as CliIndex.php.
%mRequest Method. Such as Get; When Cli it's the command script, Such as /bin/bash.
%IClient IP; When Cli it's local. Priority value: HTTP_X_REAL_IP > HTTP_X_FORWARDED_FOR > REMOTE_ADDR
%FFileName:LineNo. Such as UserService.php:118.
%UMemoryUsage. byte. Call zend_memory_usage.
%uPeakMemoryUsage. byte. Call zend_memory_peak_usage.
%CTODO Class::Action. Such as UserService::getUserInfo
To Top