Skip to content

Instantly share code, notes, and snippets.

@lbp0200
Last active January 9, 2016 08:18
Show Gist options
  • Save lbp0200/2f45522ceb2b48f06e93 to your computer and use it in GitHub Desktop.
Save lbp0200/2f45522ceb2b48f06e93 to your computer and use it in GitHub Desktop.
PHP记录日志的正确姿势(linux下适用)
openlog('php program', LOG_PID, LOG_USER);
syslog(LOG_ERR, "This is a test: " . memory_get_usage(true));
#rsyslog.conf
if $programname == 'php program' then /var/log/fuckphp.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment