CUBRID Engine  latest
shard_proxy_log.c File Reference
#include <assert.h>
#include "shard_proxy_log.h"
#include "broker_util.h"
#include "cas_util.h"
Include dependency graph for shard_proxy_log.c:

Go to the source code of this file.

Macros

#define PROXY_LOG_BUFFER_SIZE   (8192)
 

Functions

static char * make_proxy_log_filename (char *filepath_buf, size_t buf_size, const char *br_name, int proxy_index)
 
static void proxy_log_backup (void)
 
static void proxy_log_write_internal (int level, char *svc_code, bool do_flush, const char *fmt, va_list ap)
 
static void proxy_log_reset (void)
 
static FILE * log_open (char *log_file_name)
 
void proxy_log_open (char *br_name, int proxy_index)
 
void proxy_log_close (void)
 
void proxy_log_end (void)
 
void proxy_log_write (int level, char *svc_code, const char *fmt,...)
 
int proxy_log_get_level (void)
 
int proxy_access_log (struct timeval *start_time, int client_ip_addr, const char *dbname, const char *dbuser, bool accepted)
 
void proxy_access_log_close (void)
 

Variables

static FILE * log_fp = NULL
 
static FILE * access_log_fp = NULL
 
static char log_filepath [BROKER_PATH_MAX]
 
int proxy_id
 
T_SHM_APPL_SERVERshm_as_p
 
T_SHM_PROXYshm_proxy_p
 
T_PROXY_INFOproxy_info_p
 
static const char * proxy_log_level_str []
 

Macro Definition Documentation

#define PROXY_LOG_BUFFER_SIZE   (8192)

Definition at line 32 of file shard_proxy_log.c.

Referenced by proxy_log_write_internal().

Function Documentation

static FILE * log_open ( char *  log_file_name)
static

Definition at line 367 of file shard_proxy_log.c.

References dirname(), NULL, and strdup().

Referenced by proxy_access_log().

Here is the caller graph for this function:

static char * make_proxy_log_filename ( char *  filepath_buf,
size_t  buf_size,
const char *  br_name,
int  proxy_index 
)
static

Definition at line 65 of file shard_proxy_log.c.

References assert, BROKER_PATH_MAX, dirname(), NULL, and t_shm_appl_server::proxy_log_dir.

Referenced by proxy_log_open().

Here is the caller graph for this function:

int proxy_access_log ( struct timeval *  start_time,
int  client_ip_addr,
const char *  dbname,
const char *  dbuser,
bool  accepted 
)

Definition at line 275 of file shard_proxy_log.c.

References t_proxy_info::access_log_file, access_log_fp, log_open(), NULL, p, t_proxy_info::proxy_access_log_reset, and ut_uchar2ipstr().

Referenced by proxy_process_client_register().

Here is the caller graph for this function:

void proxy_access_log_close ( void  )

Definition at line 357 of file shard_proxy_log.c.

References access_log_fp, and NULL.

Referenced by proxy_term().

Here is the caller graph for this function:

static void proxy_log_backup ( void  )
static

Definition at line 139 of file shard_proxy_log.c.

References assert, BROKER_PATH_MAX, and log_filepath.

Referenced by proxy_log_end().

Here is the caller graph for this function:

void proxy_log_close ( void  )

Definition at line 129 of file shard_proxy_log.c.

References log_fp, and NULL.

Referenced by proxy_log_end(), proxy_log_open(), proxy_log_reset(), and proxy_term().

Here is the caller graph for this function:

void proxy_log_end ( void  )

Definition at line 155 of file shard_proxy_log.c.

References t_shm_appl_server::broker_name, log_fp, proxy_id, proxy_log_backup(), proxy_log_close(), t_shm_appl_server::proxy_log_max_size, and proxy_log_open().

Referenced by proxy_log_write().

Here is the caller graph for this function:

int proxy_log_get_level ( void  )

Definition at line 269 of file shard_proxy_log.c.

References t_proxy_info::cur_proxy_log_mode.

void proxy_log_open ( char *  br_name,
int  proxy_index 
)
static void proxy_log_reset ( void  )
static

Definition at line 115 of file shard_proxy_log.c.

References t_shm_appl_server::broker_name, log_fp, NULL, proxy_id, proxy_log_close(), proxy_log_open(), and t_proxy_info::proxy_log_reset.

Referenced by proxy_log_write().

Here is the caller graph for this function:

void proxy_log_write ( int  level,
char *  svc_code,
const char *  fmt,
  ... 
)
static void proxy_log_write_internal ( int  level,
char *  svc_code,
bool  do_flush,
const char *  fmt,
va_list  ap 
)
static

Definition at line 174 of file shard_proxy_log.c.

References log_fp, NULL, p, PROXY_LOG_BUFFER_SIZE, proxy_log_level_str, and ut_time_string().

Referenced by proxy_log_write().

Here is the caller graph for this function:

Variable Documentation

FILE* access_log_fp = NULL
static

Definition at line 46 of file shard_proxy_log.c.

Referenced by proxy_access_log(), and proxy_access_log_close().

char log_filepath[BROKER_PATH_MAX]
static

Definition at line 47 of file shard_proxy_log.c.

Referenced by proxy_log_backup(), and proxy_log_open().

T_PROXY_INFO* proxy_info_p

Definition at line 48 of file shard_proxy.c.

const char* proxy_log_level_str[]
static
Initial value:
= {
"NUL",
"ERR",
"TMO",
"NTC",
"SRD",
"SCH",
"DBG"
}

Definition at line 54 of file shard_proxy_log.c.

Referenced by proxy_log_write_internal().

T_SHM_PROXY* shm_proxy_p

Definition at line 109 of file broker_admin_pub.c.