log
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
log(*args)
public
Log a message with the specified priority. Example:
Syslog.log(Syslog::LOG_CRIT, "Out of disk space") Syslog.log(Syslog::LOG_CRIT, "User %s logged in", ENV['USER'])
The priority levels, in descending order, are:
LOG_EMERG |
System is unusable |
LOG_ALERT |
Action needs to be taken immediately |
LOG_CRIT |
A critical condition has occurred |
LOG_ERR |
An error occurred |
LOG_WARNING |
Warning of a possible problem |
LOG_NOTICE |
A normal but significant condition occurred |
LOG_INFO |
Informational message |
LOG_DEBUG |
Debugging information |
Each priority level also has a shortcut method that logs with it’s named priority. As an example, the two following statements would produce the same result:
Syslog.log(Syslog::LOG_ALERT, "Out of memory") Syslog.alert("Out of memory")
Format strings are as for printf/sprintf, except that in addition %m is replaced with the error message string that would be returned by strerror(errno).