ze-filter  (ze-filter-0.8.0-develop-180218)
Tools : ze-filter logging

Classes

struct  LOG_T
 

Macros

#define WARN_MSG_SIZE   0x4000
 
#define LOG_SPAM_CHECK(id, ...)
 
#define LOG_ORACLE(id, ...)
 
#define JC_LOG_NONE   0
 
#define JC_LOG_SYSLOG   1
 
#define JC_LOG_FILE   2
 
#define JC_LOG_UDP   3
 
#define ARGVM   9
 
#define LOGNAME_REGEX   "^(none|syslog|file|udp):"
 
#define LOG_INITIALIZER
 
#define log_check_and_open(log, name)   (log_ready(log) || log_open(log, name))
 
#define ADJUST_LOG_NAME(path, fname, dir, defval)
 

Functions

sfsistat do_notify (SMFICTX *, attachment_T *, char *, char *, char *)
 
void read_error_msg (char *buf, int, attachment_T *, char *, char *, char *, char *, CTXPRIV_T *)
 
void log_msg_context (SMFICTX *ctx, char *why)
 
bool add_tag2subject (SMFICTX *, char *)
 
bool open_scores4stats_file ()
 
bool reopen_scores4stats_file ()
 
bool dump_msg_scores4stats (SMFICTX *ctx)
 
bool log_attached_files (char *, char *, attachment_T *)
 
bool log_attached_files_ropen ()
 
void log_grey_expire (char *)
 
bool log_grey_expire_reopen ()
 
void log_quarantine (SMFICTX *, attachment_T *)
 
bool log_quarantine_reopen ()
 
bool log_found_regex (char *, char *, char *, int, int, char *)
 
bool log_regex_reopen ()
 
void log_virus (char *, char *, char *)
 
bool log_virus_reopen ()
 
bool log_init (LOG_T *)
 
bool log_debug (LOG_T *, bool)
 
bool log_lock (LOG_T *)
 
bool log_unlock (LOG_T *)
 
bool log_ready (LOG_T *)
 
bool log_open (LOG_T *, char *)
 
bool log_reopen (LOG_T *)
 
bool log_close (LOG_T *)
 
bool log_write (LOG_T *, char *)
 
bool log_printf (LOG_T *, char *,...)
 
int log_error (LOG_T *)
 

Variables

bool mailregexlog2file
 

Detailed Description

Macro Definition Documentation

◆ ADJUST_LOG_NAME

#define ADJUST_LOG_NAME (   path,
  fname,
  dir,
  defval 
)
Value:
do { \
char *name = NULL; \
name = (fname != NULL && strlen(fname) > 0) ? fname : defval; \
if (zeStrRegex(name, LOGNAME_REGEX, NULL, NULL, TRUE)) { \
strlcpy(path, name, sizeof(path)); \
} else { \
strcpy(path, ""); \
if (*name == '/') \
snprintf(path, sizeof(path), "file:%s", name); \
else \
snprintf(path, sizeof(path), "file:%s/%s", dir, name); \
} \
zeLog_MessageInfo(12, "Adjusted path is %s", path); \
} while (FALSE);
#define LOGNAME_REGEX
Definition: ze-txtlog.h:46
#define FALSE
Definition: macros.h:160
bool zeStrRegex(char *, char *, long *, long *, bool)
Definition: zeStrings.c:544
#define TRUE
Definition: macros.h:157

Definition at line 133 of file ze-txtlog.h.

◆ ARGVM

#define ARGVM   9

Definition at line 44 of file ze-txtlog.h.

◆ JC_LOG_FILE

#define JC_LOG_FILE   2

Definition at line 35 of file ze-txtlog.h.

◆ JC_LOG_NONE

#define JC_LOG_NONE   0

Definition at line 33 of file ze-txtlog.h.

◆ JC_LOG_SYSLOG

#define JC_LOG_SYSLOG   1

Definition at line 34 of file ze-txtlog.h.

◆ JC_LOG_UDP

#define JC_LOG_UDP   3

Definition at line 36 of file ze-txtlog.h.

◆ log_check_and_open

#define log_check_and_open (   log,
  name 
)    (log_ready(log) || log_open(log, name))

Definition at line 130 of file ze-txtlog.h.

◆ LOG_INITIALIZER

#define LOG_INITIALIZER
Value:
{ \
SIGNATURE, \
PTHREAD_MUTEX_INITIALIZER, \
PTHREAD_MUTEX_INITIALIZER, \
FALSE, \
FALSE, \
0, \
0, \
(time_t ) 0, \
FALSE, \
NULL, \
NULL, \
0 \
}
#define FALSE
Definition: macros.h:160
#define JC_LOG_NONE
Definition: ze-txtlog.h:33

Definition at line 96 of file ze-txtlog.h.

◆ LOG_ORACLE

#define LOG_ORACLE (   id,
  ... 
)
Value:
do { \
if (log_level >= 9 && cf_get_int(CF_LOG_LEVEL_ORACLE) >= 1) \
{ \
char sxa[256], sxb[256]; \
snprintf(sxa, sizeof(sxa), "%s ORACLE", id); \
snprintf(sxb, sizeof(sxb), __VA_ARGS__); \
j_syslog(LOG_NOTICE, "%s - %s", sxa, sxb); \
} \
} while (0)
#define CF_LOG_LEVEL_ORACLE
Definition: cfh-defs.h:126
int cf_get_int(int id)
Definition: ze-cf.c:803

Definition at line 57 of file ze-callbacklogs.h.

◆ LOG_SPAM_CHECK

#define LOG_SPAM_CHECK (   id,
  ... 
)
Value:
do { \
if (log_level >= 9 && cf_get_int(CF_LOG_LEVEL_ORACLE) >= 2) \
{ \
char sxa[256], sxb[256]; \
snprintf(sxa, sizeof(sxa), "%s SPAM CHECK", id); \
snprintf(sxb, sizeof(sxb), __VA_ARGS__); \
j_syslog(LOG_NOTICE, "%s - %s", sxa, sxb); \
} \
} while (0)
#define CF_LOG_LEVEL_ORACLE
Definition: cfh-defs.h:126
int cf_get_int(int id)
Definition: ze-cf.c:803

Definition at line 46 of file ze-callbacklogs.h.

◆ LOGNAME_REGEX

#define LOGNAME_REGEX   "^(none|syslog|file|udp):"

Definition at line 46 of file ze-txtlog.h.

◆ WARN_MSG_SIZE

#define WARN_MSG_SIZE   0x4000

Definition at line 33 of file ze-callbacklogs.h.

Function Documentation

◆ add_tag2subject()

bool add_tag2subject ( SMFICTX *  ,
char *   
)

Definition at line 663 of file ze-callbacklogs.c.

◆ do_notify()

sfsistat do_notify ( SMFICTX *  ,
attachment_T ,
char *  ,
char *  ,
char *   
)

Definition at line 56 of file ze-callbacklogs.c.

◆ dump_msg_scores4stats()

bool dump_msg_scores4stats ( SMFICTX *  ctx)

Definition at line 764 of file ze-callbacklogs.c.

◆ log_attached_files()

bool log_attached_files ( char *  ,
char *  ,
attachment_T  
)

Definition at line 72 of file ze-log-files.c.

◆ log_attached_files_ropen()

bool log_attached_files_ropen ( )

◆ log_close()

bool log_close ( LOG_T )

Definition at line 296 of file ze-txtlog.c.

◆ log_debug()

bool log_debug ( LOG_T ,
bool   
)

Definition at line 79 of file ze-txtlog.c.

◆ log_error()

int log_error ( LOG_T )

Definition at line 383 of file ze-txtlog.c.

◆ log_found_regex()

bool log_found_regex ( char *  ,
char *  ,
char *  ,
int  ,
int  ,
char *   
)

Definition at line 79 of file ze-log-regex.c.

◆ log_grey_expire()

void log_grey_expire ( char *  rec)

Definition at line 75 of file ze-log-grey.c.

◆ log_grey_expire_reopen()

bool log_grey_expire_reopen ( )

Definition at line 48 of file ze-log-grey.c.

◆ log_init()

bool log_init ( LOG_T )

Definition at line 61 of file ze-txtlog.c.

◆ log_lock()

bool log_lock ( LOG_T )

Definition at line 98 of file ze-txtlog.c.

◆ log_msg_context()

void log_msg_context ( SMFICTX *  ctx,
char *  why 
)

Definition at line 410 of file ze-callbacklogs.c.

◆ log_open()

bool log_open ( LOG_T ,
char *   
)

Definition at line 146 of file ze-txtlog.c.

◆ log_printf()

bool log_printf ( LOG_T ,
char *  ,
  ... 
)

Definition at line 355 of file ze-txtlog.c.

◆ log_quarantine()

void log_quarantine ( SMFICTX *  ,
attachment_T  
)

Definition at line 71 of file ze-log-quarantine.c.

◆ log_quarantine_reopen()

bool log_quarantine_reopen ( )

Definition at line 45 of file ze-log-quarantine.c.

◆ log_ready()

bool log_ready ( LOG_T )

Definition at line 130 of file ze-txtlog.c.

◆ log_regex_reopen()

bool log_regex_reopen ( )

Definition at line 52 of file ze-log-regex.c.

◆ log_reopen()

bool log_reopen ( LOG_T )

Definition at line 275 of file ze-txtlog.c.

◆ log_unlock()

bool log_unlock ( LOG_T )

Definition at line 114 of file ze-txtlog.c.

◆ log_virus()

void log_virus ( char *  ,
char *  ,
char *   
)

Definition at line 71 of file ze-log-virus.c.

◆ log_virus_reopen()

bool log_virus_reopen ( )

Definition at line 45 of file ze-log-virus.c.

◆ log_write()

bool log_write ( LOG_T ,
char *   
)

Definition at line 329 of file ze-txtlog.c.

◆ open_scores4stats_file()

bool open_scores4stats_file ( )

Definition at line 710 of file ze-callbacklogs.c.

◆ read_error_msg()

void read_error_msg ( char *  buf,
int  ,
attachment_T ,
char *  ,
char *  ,
char *  ,
char *  ,
CTXPRIV_T  
)

Definition at line 155 of file ze-callbacklogs.c.

◆ reopen_scores4stats_file()

bool reopen_scores4stats_file ( )

Definition at line 728 of file ze-callbacklogs.c.

Variable Documentation

◆ mailregexlog2file

bool mailregexlog2file

Definition at line 34 of file ze-log-regex.c.