diff options
| author | Thibault "bui" Koechlin | 2019-08-31 15:32:36 +0200 |
|---|---|---|
| committer | jvoisin | 2019-08-31 13:32:36 +0000 |
| commit | 504f02992ace82a5520bc0ca43d9562c077a06e4 (patch) | |
| tree | 94934cf269abe7a8dbdf0a8bdb4ddb1d51cb4f30 /src/sp_config_keywords.c | |
| parent | f7e25b29c1cd5273675dbb3d6883c40377d8315d (diff) | |
Support direct syslog logging
Add the possibility to log directly into the syslog, instead of using php's log system.
Diffstat (limited to 'src/sp_config_keywords.c')
| -rw-r--r-- | src/sp_config_keywords.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index abb3110..aebe45c 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c | |||
| @@ -83,6 +83,25 @@ int parse_random(char *line) { | |||
| 83 | NULL); | 83 | NULL); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | int parse_log_media(char *line) { | ||
| 87 | size_t consumed = 0; | ||
| 88 | zend_string *value = | ||
| 89 | get_param(&consumed, line, SP_TYPE_STR, SP_TOKEN_LOG_MEDIA); | ||
| 90 | |||
| 91 | if (value) { | ||
| 92 | if (!strcmp(ZSTR_VAL(value), "php")) { | ||
| 93 | SNUFFLEUPAGUS_G(config).log_media = SP_ZEND; | ||
| 94 | return 0; | ||
| 95 | } else if (!strcmp(ZSTR_VAL(value), "syslog")) { | ||
| 96 | SNUFFLEUPAGUS_G(config).log_media = SP_SYSLOG; | ||
| 97 | return 0; | ||
| 98 | } | ||
| 99 | } | ||
| 100 | sp_log_err("config", "%s) only supports 'syslog' or 'php', on line %zu", | ||
| 101 | SP_TOKEN_LOG_MEDIA, sp_line_no); | ||
| 102 | return -1; | ||
| 103 | } | ||
| 104 | |||
| 86 | int parse_sloppy_comparison(char *line) { | 105 | int parse_sloppy_comparison(char *line) { |
| 87 | return parse_enable(line, &(SNUFFLEUPAGUS_G(config).config_sloppy->enable), | 106 | return parse_enable(line, &(SNUFFLEUPAGUS_G(config).config_sloppy->enable), |
| 88 | NULL); | 107 | NULL); |
