Skip to content

Instantly share code, notes, and snippets.

@theharveyz
Created December 5, 2016 17:55
Show Gist options
  • Save theharveyz/87bad6bc0338f6a9632a17fa6e6c1d0b to your computer and use it in GitHub Desktop.
Save theharveyz/87bad6bc0338f6a9632a17fa6e6c1d0b to your computer and use it in GitHub Desktop.
php生成一个system log 日志
<?php
// open syslog, include the process ID and also send
// the log to standard error, and use a user defined
// logging mechanism
openlog("myScriptLog", LOG_PID | LOG_PERROR, LOG_LOCAL0);
$access = date("Y/m/d H:i:s");
syslog(LOG_WARNING, "Unauthorized client: $access");
closelog();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment