log file: add type flag

It will be used to store if the file is syslog or a real file.
pull/1502/head
Eric Leblond 10 years ago committed by Victor Julien
parent 7d73db9b80
commit 636e3d93c0

@ -39,10 +39,7 @@ TmEcode OutputJSON(json_t *js, void *data, uint64_t *count);
int OutputJSONBuffer(json_t *js, LogFileCtx *file_ctx, MemBuffer *buffer);
OutputCtx *OutputJsonInitCtx(ConfNode *);
enum JsonOutput { ALERT_FILE,
ALERT_SYSLOG,
ALERT_UNIX_DGRAM,
ALERT_UNIX_STREAM };
enum JsonFormat { COMPACT, INDENT };
/*
@ -50,11 +47,10 @@ enum JsonFormat { COMPACT, INDENT };
*/
typedef struct OutputJsonCtx_ {
LogFileCtx *file_ctx;
enum JsonOutput json_out;
enum LogFileType json_out;
enum JsonFormat format;
} OutputJsonCtx;
typedef struct AlertJsonThread_ {
/** LogFileCtx has the pointer to the file and a mutex to allow multithreading */
LogFileCtx *file_ctx;

@ -31,6 +31,11 @@ typedef struct {
uint16_t fileno;
} PcieFile;
enum LogFileType { ALERT_FILE,
ALERT_SYSLOG,
ALERT_UNIX_DGRAM,
ALERT_UNIX_STREAM };
/** Global structure for Output Context */
typedef struct LogFileCtx_ {
union {
@ -45,6 +50,9 @@ typedef struct LogFileCtx_ {
* record cannot be written to the file in one call */
SCMutex fp_mutex;
/** the type of file */
enum LogFileType type;
/** The name of the file */
char *filename;

Loading…
Cancel
Save