xdasd_logger.c File Reference

OpenXDAS daemon back-end logger manager. More...

#include <xdas_base.h>
#include "xdasd_logger.h"
#include "xdasd_parse.h"
#include "xdasd_mqueue.h"
#include "xdasd_mcache.h"
#include "xdasd_conf.h"
#include "xdasd_log.h"
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dlfcn.h>

Go to the source code of this file.

Data Structures

struct  xdasd_logger_tag
 A structure that tracks the library handle and imported symbols. More...

Defines

#define XDASD_MAX_LOGGERS   16
 The maximum simultaneous loaded loggers we can handle.
Logger Module Symbol Names
#define XDM_INIT_SYM_NAME   "xdm_init"
#define XDM_APND_SYM_NAME   "xdm_append"
#define XDM_EXIT_SYM_NAME   "xdm_exit"

Typedefs

typedef void * xdasd_lib_t
 An abstraction for a loaded library handle.
typedef void(* xdasd_fptr_t )(void)
 An abstraction for a generic function pointer.
typedef int logger_init_fn_t (void(*logmsg)(int level, const char *,...), char *(*getcnfstr)(const char *, char *, size_t *))
 Typedefs for function pointers.
typedef int logger_apnd_fn_t (const char **fields)
typedef void logger_exit_fn_t (void)
typedef struct xdasd_logger_tag xdasd_logger_t
 A structure that tracks the library handle and imported symbols.

Functions

static xdasd_lib_t xdasd_load_library (const char *libname)
 Load a library dynamically.
static xdasd_fptr_t xdasd_import_symbol (xdasd_lib_t lib, const char *sym)
 Import a symbol dynamically.
static void xdasd_free_library (xdasd_lib_t lib)
 Free a dynamically loaded library.
void logger_clear (void)
 Clear the global logger list by unloading all loaded loggers.
static int logger_put (void *data)
 A MsgQueue 'put' routine for message log processing.
static void * logger_get (void)
 A MsgQueue 'get' routine for message log processing.
static void logger_append (void *data)
 A MsgQueue 'process' routine for message log processing.
int xdasd_logger_append (Parsed *parsed)
 Appends a message to the file based persistent cache queue.
int xdasd_logger_init (const char *msgfdir)
 Initialize the loadable back-end logger sub-system.
void xdasd_logger_exit (void)
 Cleanup the loadable back-end logger sub-system.

Variables

static xdasd_logger_t s_loggers [XDASD_MAX_LOGGERS]
 The array of loaded and initialized back-end loggers.
static MsgQueue s_mq_logger = 0
static MsgCache s_mcache = 0


Detailed Description

OpenXDAS daemon back-end logger manager.

Author:
John Calcote (jcalcote@novell.com)
Attention:
Please submit patches to http://openxdas.sourceforge.net

Definition in file xdasd_logger.c.


Generated on Thu Aug 20 22:33:07 2009 for OpenXDAS by  doxygen 1.5.6