CUBRID Engine  latest
shard_proxy_log.h File Reference
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/time.h>
#include "broker_shm.h"
#include "broker_config.h"
Include dependency graph for shard_proxy_log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PROXY_LOG(level, fmt, args...)
 
#define PROXY_DEBUG_LOG(fmt, args...)
 
#define ENTER_FUNC()
 
#define EXIT_FUNC()
 
#define DEBUG_FUNC()
 

Functions

void proxy_log_open (char *br_name, int proxy_index)
 
void proxy_log_close (void)
 
void proxy_access_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)
 

Macro Definition Documentation

#define DEBUG_FUNC ( )

Definition at line 124 of file shard_proxy_log.h.

#define ENTER_FUNC ( )

Definition at line 112 of file shard_proxy_log.h.

Referenced by fn_proxy_cas_end_tran(), fn_proxy_cas_fetch(), fn_proxy_cas_prepare(), fn_proxy_cas_prepare_and_execute(), fn_proxy_cas_relay_only(), fn_proxy_cas_schema_info(), fn_proxy_client_check_cas(), fn_proxy_client_close_req_handle(), fn_proxy_client_con_close(), fn_proxy_client_conn_error(), fn_proxy_client_cursor(), fn_proxy_client_cursor_close(), fn_proxy_client_end_tran(), fn_proxy_client_fetch(), fn_proxy_client_get_db_version(), fn_proxy_client_not_supported(), fn_proxy_client_prepare(), fn_proxy_client_schema_info(), fn_proxy_get_shard_info(), proxy_cas_execute_internal(), proxy_cas_io_free(), proxy_cas_io_free_by_ctx(), proxy_cas_release_by_ctx(), proxy_client_add_waiter_by_shard(), proxy_client_check_waiter_and_wakeup(), proxy_client_execute_internal(), proxy_context_free(), proxy_context_free_client(), proxy_context_free_shard(), proxy_context_send_error(), proxy_handler_process_cas_conn_error(), proxy_handler_process_cas_error(), proxy_handler_process_cas_event(), proxy_handler_process_cas_response(), proxy_handler_process_client_conn_error(), proxy_handler_process_client_event(), proxy_handler_process_client_request(), proxy_handler_process_client_wakeup_by_shard(), proxy_handler_process_client_wakeup_by_statement(), proxy_process_cas_conn_error(), proxy_process_cas_register(), proxy_process_cas_response(), proxy_process_client_conn_error(), proxy_process_client_register(), proxy_process_client_request(), proxy_send_request_to_cas(), proxy_send_request_to_cas_with_new_event(), proxy_send_response_to_client(), proxy_socket_io_clear(), proxy_socket_io_delete(), proxy_socket_io_new_client(), shard_stmt_check_waiter_and_wakeup(), shard_stmt_del_all_srv_h_id_for_shard_cas(), shard_stmt_del_srv_h_id_for_shard_cas(), shard_stmt_free(), and shard_stmt_lru_delete().

#define EXIT_FUNC ( )

Definition at line 118 of file shard_proxy_log.h.

Referenced by fn_proxy_cas_end_tran(), fn_proxy_cas_fetch(), fn_proxy_cas_prepare(), fn_proxy_cas_prepare_and_execute(), fn_proxy_cas_relay_only(), fn_proxy_cas_schema_info(), fn_proxy_client_check_cas(), fn_proxy_client_close_req_handle(), fn_proxy_client_con_close(), fn_proxy_client_conn_error(), fn_proxy_client_cursor(), fn_proxy_client_cursor_close(), fn_proxy_client_end_tran(), fn_proxy_client_fetch(), fn_proxy_client_get_db_version(), fn_proxy_client_not_supported(), fn_proxy_client_prepare(), fn_proxy_client_prepare_and_execute(), fn_proxy_client_schema_info(), fn_proxy_get_shard_info(), proxy_cas_execute_internal(), proxy_cas_io_free(), proxy_cas_io_free_by_ctx(), proxy_cas_release_by_ctx(), proxy_client_add_waiter_by_shard(), proxy_client_check_waiter_and_wakeup(), proxy_client_execute_internal(), proxy_context_free(), proxy_context_free_client(), proxy_context_free_shard(), proxy_context_send_error(), proxy_handler_process_cas_conn_error(), proxy_handler_process_cas_error(), proxy_handler_process_cas_event(), proxy_handler_process_cas_response(), proxy_handler_process_client_conn_error(), proxy_handler_process_client_event(), proxy_handler_process_client_request(), proxy_handler_process_client_wakeup_by_shard(), proxy_handler_process_client_wakeup_by_statement(), proxy_io_set_established_by_ctx(), proxy_process_cas_conn_error(), proxy_process_cas_register(), proxy_process_cas_response(), proxy_process_client_conn_error(), proxy_process_client_register(), proxy_process_client_request(), proxy_send_prepared_stmt_to_client(), proxy_send_request_to_cas(), proxy_send_request_to_cas_with_new_event(), proxy_send_response_to_client(), proxy_socket_io_clear(), proxy_socket_io_delete(), proxy_socket_io_new_client(), shard_stmt_check_waiter_and_wakeup(), shard_stmt_del_all_srv_h_id_for_shard_cas(), shard_stmt_del_srv_h_id_for_shard_cas(), shard_stmt_free(), and shard_stmt_lru_delete().

#define PROXY_DEBUG_LOG (   fmt,
  args... 
)
Value:
do { \
{ \
NULL, "%s(%d): " fmt, \
__FILE__, __LINE__, \
##args); \
} \
} while(0)
int proxy_log_get_level(void)
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958
void proxy_log_write(int level, char *svc_code, const char *fmt,...)

Definition at line 97 of file shard_proxy_log.h.

Referenced by fn_proxy_cas_end_tran(), fn_proxy_client_prepare(), fn_proxy_client_prepare_and_execute(), proxy_available_cas_wait_timer(), proxy_cas_alloc_anything(), proxy_cas_alloc_by_shard_and_cas_id(), proxy_cas_find_io_by_ctx(), proxy_cas_io_find_by_fd(), proxy_cas_io_free(), proxy_cas_io_free_by_ctx(), proxy_cas_release_by_ctx(), proxy_client_add_waiter_by_shard(), proxy_client_check_waiter_and_wakeup(), proxy_context_add_stmt(), proxy_context_free_stmt(), proxy_handler_process_cas_conn_error(), proxy_handler_process_cas_response(), proxy_io_make_error_msg(), proxy_io_process(), proxy_process_cas_conn_error(), proxy_process_cas_register(), proxy_process_client_register(), proxy_shard_io_find(), proxy_socket_io_clear(), proxy_socket_io_delete(), proxy_socket_io_read(), proxy_socket_io_read_internal(), proxy_socket_io_write(), proxy_waiter_timeout(), proxy_wakeup_context_by_shard(), proxy_wakeup_context_by_statement(), shard_stmt_add_srv_h_id_for_shard_cas(), shard_stmt_check_waiter_and_wakeup(), shard_stmt_destroy(), shard_stmt_free(), shard_stmt_lru_delete(), shard_stmt_lru_insert(), shard_stmt_pin(), shard_stmt_pos_srv_h_id(), and shard_stmt_put_statement_to_map().

#define PROXY_LOG (   level,
  fmt,
  args... 
)
Value:
do { \
&& level <= PROXY_LOG_MODE_ALL \
&& level <= proxy_log_get_level()) \
{ \
NULL, "%s(%d): " fmt, \
__FILE__, __LINE__, \
##args); \
} \
} while(0)
int proxy_log_get_level(void)
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958
void proxy_log_write(int level, char *svc_code, const char *fmt,...)

Definition at line 84 of file shard_proxy_log.h.

Function Documentation

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:

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 
)
void proxy_log_write ( int  level,
char *  svc_code,
const char *  fmt,
  ... 
)