CUBRID Engine
latest
|
Go to the source code of this file.
Macros | |
#define | ARG_FILE_LINE __FILE__, __LINE__ |
Enumerations | |
enum | ACCESS_LOG_TYPE { NEW_CONNECTION, CLIENT_CHANGED, ACL_REJECTED } |
Functions | |
void | cas_log_open (char *br_name) |
void | cas_log_reset (char *br_name) |
void | cas_log_close (bool flag) |
int | cas_access_log (struct timeval *start_time, int as_index, int client_ip_addr, char *dbname, char *dbuser, ACCESS_LOG_TYPE log_type) |
void | cas_log_end (int mode, int run_time_sec, int run_time_msec) |
void | cas_log_write_nonl (unsigned int seq_num, bool unit_start, const char *fmt,...) |
void | cas_log_write (unsigned int seq_num, bool unit_start, const char *fmt,...) |
void | cas_log_write_and_end (unsigned int seq_num, bool unit_start, const char *fmt,...) |
void | cas_log_write2_nonl (const char *fmt,...) |
void | cas_log_write2 (const char *fmt,...) |
void | cas_log_write_value_string (char *value, int size) |
void | cas_log_write_query_string (char *query, int size) |
void | cas_log_write_client_ip (const unsigned char *ip_addr) |
void | cas_log_write_query_string_nonl (char *query, int size) |
void | cas_log_debug (const char *file_name, const int line_no, const char *fmt,...) |
char * | cas_log_query_plan_file (int id) |
void | cas_log_query_info_init (int id, char is_only_query_plan) |
void | cas_slow_log_open (char *br_name) |
void | cas_slow_log_reset (char *br_name) |
void | cas_slow_log_close (void) |
void | cas_slow_log_end (void) |
void | cas_slow_log_write (struct timeval *log_time, unsigned int seq_num, bool unit_start, const char *fmt,...) |
void | cas_slow_log_write_and_end (struct timeval *log_time, unsigned int seq_num, const char *fmt,...) |
void | cas_slow_log_write2 (const char *fmt,...) |
void | cas_slow_log_write_value_string (char *value, int size) |
void | cas_slow_log_write_query_string (char *query, int size) |
enum ACCESS_LOG_TYPE |
int cas_access_log | ( | struct timeval * | start_time, |
int | as_index, | ||
int | client_ip_addr, | ||
char * | dbname, | ||
char * | dbuser, | ||
ACCESS_LOG_TYPE | log_type | ||
) |
Definition at line 784 of file cas_log.c.
References access_log_backup(), ACCESS_LOG_DENIED_FILENAME_POSTFIX, t_shm_appl_server::access_log_file, ACCESS_LOG_IS_DENIED_TYPE, t_shm_appl_server::access_log_max_size, access_log_open(), cas_fclose(), cas_fprintf(), db_get_session_id(), get_access_log_type_string(), NULL, ONE_K, shm_appl, and ut_get_ipv4_string().
Referenced by cas_main().
void cas_log_close | ( | bool | flag | ) |
Definition at line 234 of file cas_log.c.
References cas_fclose(), cas_fileno(), cas_fseek(), cas_ftruncate(), log_fp, NULL, and saved_log_fpos.
Referenced by cas_free(), cas_log_end(), cas_log_open(), cas_log_reset(), cas_main(), and shard_cas_main().
Definition at line 701 of file cas_log.c.
References access_log_open(), cas_fclose(), cas_fprintf(), cas_fputc(), cas_ftell(), cas_fwrite(), t_shm_appl_server::error_log_file, log_fp, NULL, p, PATH_INFO_ENV_STR, shm_appl, strlen, ut_time_string(), and ut_uchar2ipstr().
Referenced by cas_free(), cas_main(), err_msg_set(), error_info_set_with_msg(), fn_end_tran(), fn_execute_internal(), net_read_int_keep_con_auto(), net_read_process(), process_request(), set_db_connection_info(), shard_cas_main(), ux_check_connection(), ux_database_connect(), ux_database_shutdown(), ux_end_tran(), ux_lob_new(), ux_lob_read(), and ux_lob_write().
void cas_log_end | ( | int | mode, |
int | run_time_sec, | ||
int | run_time_msec | ||
) |
Definition at line 319 of file cas_log.c.
References as_info, t_shm_appl_server::broker_name, cas_ftell(), cas_log_backup(), cas_log_close(), cas_log_open(), cas_log_write(), cas_log_write_and_set_savedpos(), t_appl_server_info::cur_sql_log_mode, FID_SQL_LOG_DIR, log_fp, t_shm_appl_server::long_transaction_time, NULL, saved_log_fpos, shm_appl, t_shm_appl_server::sql_log_max_size, SQL_LOG_MODE_ALL, SQL_LOG_MODE_ERROR, SQL_LOG_MODE_NONE, SQL_LOG_MODE_NOTICE, and SQL_LOG_MODE_TIMEOUT.
Referenced by cas_log_write_and_end(), fn_end_tran(), and ux_auto_commit().
void cas_log_open | ( | char * | br_name | ) |
Definition at line 163 of file cas_log.c.
References as_info, BROKER_PATH_MAX, cas_fopen(), cas_fseek(), cas_ftell(), cas_log_close(), t_appl_server_info::cas_log_reset, CAS_LOG_RESET_REOPEN, t_appl_server_info::cur_sql_log_mode, FID_SQL_LOG_DIR, t_shm_appl_server::log_dir, log_filepath, log_fp, make_sql_log_filename(), NULL, saved_log_fpos, set_cubrid_file(), shm_appl, sql_log_buffer, SQL_LOG_BUFFER_SIZE, and SQL_LOG_MODE_NONE.
Referenced by cas_log_end(), cas_log_reset(), cas_log_write(), cas_log_write2(), cas_log_write2_nonl(), cas_log_write_and_end(), cas_log_write_nonl(), cas_log_write_query_string_internal(), cas_log_write_value_string(), cas_main(), and shard_cas_main().
void cas_log_query_info_init | ( | int | id, |
char | is_only_query_plan | ||
) |
Definition at line 871 of file cas_log.c.
References cas_log_query_plan_file(), cas_unlink(), db_query_plan_dump_file(), and set_optimization_level().
Referenced by fn_get_query_info(), ux_execute(), and ux_prepare().
char* cas_log_query_plan_file | ( | int | id | ) |
Definition at line 892 of file cas_log.c.
References assert, BROKER_PATH_MAX, dirname(), FID_CAS_TMP_DIR, get_cubrid_file(), and NULL.
Referenced by cas_log_query_info_init(), srv_handle_rm_tmp_file(), ux_execute(), and ux_get_query_info().
void cas_log_reset | ( | char * | br_name | ) |
Definition at line 211 of file cas_log.c.
References as_info, cas_log_close(), cas_log_open(), t_appl_server_info::cas_log_reset, CAS_LOG_RESET_REMOVE, cas_unlink(), t_appl_server_info::cur_sql_log_mode, log_filepath, log_fp, NULL, and SQL_LOG_MODE_NONE.
Referenced by fn_end_tran(), net_read_int_keep_con_auto(), net_read_process(), and process_request().
Definition at line 506 of file cas_log.c.
References as_info, t_shm_appl_server::broker_name, cas_fputc(), cas_ftell(), cas_log_open(), cas_log_query_cancel(), cas_log_write_internal(), t_appl_server_info::cur_sql_log_mode, log_fp, NULL, saved_log_fpos, shm_appl, SQL_LOG_MODE_ALL, and SQL_LOG_MODE_NONE.
Referenced by cas_init_ssl(), cas_log_end(), fn_check_cas(), fn_close_req_handle(), fn_con_close(), fn_cursor_close(), fn_cursor_update(), fn_end_tran(), fn_execute_array(), fn_execute_batch(), fn_execute_internal(), fn_fetch(), fn_get_class_num_objs(), fn_get_db_parameter(), fn_get_db_version(), fn_get_generated_keys(), fn_lob_new(), fn_lob_read(), fn_lob_write(), fn_next_result(), fn_oid(), fn_oid_get(), fn_oid_put(), fn_prepare_and_execute(), fn_prepare_internal(), fn_savepoint(), fn_schema_info(), fn_set_cas_change_mode(), fn_set_db_parameter(), fn_xa_end_tran(), fn_xa_prepare(), fn_xa_recover(), set_query_timeout(), and ux_auto_commit().
void cas_log_write2 | ( | const char * | fmt, |
... | |||
) |
Definition at line 604 of file cas_log.c.
References as_info, t_shm_appl_server::broker_name, cas_fputc(), cas_log_open(), cas_log_write2_internal(), t_appl_server_info::cur_sql_log_mode, log_fp, NULL, shm_appl, SQL_LOG_MODE_ALL, and SQL_LOG_MODE_NONE.
Referenced by cas_main(), shard_cas_main(), and ux_execute_batch().
void cas_log_write2_nonl | ( | const char * | fmt, |
... | |||
) |
Definition at line 584 of file cas_log.c.
References as_info, t_shm_appl_server::broker_name, cas_log_open(), cas_log_write2_internal(), t_appl_server_info::cur_sql_log_mode, log_fp, NULL, shm_appl, SQL_LOG_MODE_ALL, and SQL_LOG_MODE_NONE.
Referenced by bind_value_log(), bind_value_print(), and ux_execute_batch().
Definition at line 533 of file cas_log.c.
References as_info, t_shm_appl_server::broker_name, cas_fputc(), cas_ftell(), cas_log_end(), cas_log_open(), cas_log_write_internal(), t_appl_server_info::cur_sql_log_mode, log_fp, NULL, saved_log_fpos, shm_appl, SQL_LOG_MODE_ALL, and SQL_LOG_MODE_NONE.
Referenced by cas_free(), cas_init_ssl(), cas_log_write_client_ip(), cas_main(), cas_register_to_proxy(), cas_set_session_id(), cas_ssl_read(), cas_ssl_write(), err_msg_set(), net_read_process(), process_request(), report_abnormal_host_status(), set_db_parameter(), shard_cas_main(), and ux_check_connection().
void cas_log_write_client_ip | ( | const unsigned char * | ip_addr | ) |
Definition at line 686 of file cas_log.c.
References cas_log_write_and_end(), NULL, and ut_get_ipv4_string().
Referenced by net_read_process().
Definition at line 442 of file cas_log.c.
References as_info, t_shm_appl_server::broker_name, cas_ftell(), cas_log_open(), cas_log_write_internal(), t_appl_server_info::cur_sql_log_mode, log_fp, NULL, saved_log_fpos, shm_appl, SQL_LOG_MODE_ALL, and SQL_LOG_MODE_NONE.
Referenced by bind_value_log(), fn_execute_array(), fn_execute_internal(), fn_prepare_internal(), and ux_execute_batch().
void cas_log_write_query_string | ( | char * | query, |
int | size | ||
) |
Definition at line 647 of file cas_log.c.
References cas_log_write_query_string_internal().
Referenced by fn_execute_array(), fn_execute_internal(), and fn_prepare_internal().
void cas_log_write_query_string_nonl | ( | char * | query, |
int | size | ||
) |
Definition at line 641 of file cas_log.c.
References cas_log_write_query_string_internal().
Referenced by ux_execute_batch().
void cas_log_write_value_string | ( | char * | value, |
int | size | ||
) |
Definition at line 625 of file cas_log.c.
References as_info, t_shm_appl_server::broker_name, cas_fwrite(), cas_log_open(), t_appl_server_info::cur_sql_log_mode, log_fp, NULL, shm_appl, and SQL_LOG_MODE_NONE.
Referenced by bind_value_print().
void cas_slow_log_close | ( | void | ) |
Definition at line 1021 of file cas_log.c.
References cas_fclose(), NULL, and slow_log_fp.
Referenced by cas_free(), cas_main(), cas_slow_log_end(), cas_slow_log_open(), cas_slow_log_reset(), and shard_cas_main().
void cas_slow_log_end | ( | void | ) |
Definition at line 1033 of file cas_log.c.
References as_info, t_shm_appl_server::broker_name, cas_fflush(), cas_fputc(), cas_ftell(), cas_log_backup(), cas_slow_log_close(), cas_slow_log_open(), t_appl_server_info::cur_slow_log_mode, FID_SLOW_LOG_DIR, NULL, shm_appl, slow_log_fp, SLOW_LOG_MODE_OFF, and t_shm_appl_server::sql_log_max_size.
Referenced by cas_slow_log_write_and_end(), fn_execute_array(), and fn_execute_internal().
void cas_slow_log_open | ( | char * | br_name | ) |
Definition at line 966 of file cas_log.c.
References as_info, BROKER_PATH_MAX, cas_fopen(), CAS_LOG_RESET_REOPEN, cas_slow_log_close(), t_appl_server_info::cas_slow_log_reset, t_appl_server_info::cur_slow_log_mode, FID_SLOW_LOG_DIR, make_sql_log_filename(), NULL, set_cubrid_file(), shm_appl, t_shm_appl_server::slow_log_dir, slow_log_filepath, slow_log_fp, and SLOW_LOG_MODE_OFF.
Referenced by cas_main(), cas_slow_log_end(), cas_slow_log_reset(), cas_slow_log_write(), cas_slow_log_write2(), cas_slow_log_write_and_end(), cas_slow_log_write_query_string(), cas_slow_log_write_value_string(), and shard_cas_main().
void cas_slow_log_reset | ( | char * | br_name | ) |
Definition at line 998 of file cas_log.c.
References as_info, CAS_LOG_RESET_REMOVE, cas_slow_log_close(), cas_slow_log_open(), t_appl_server_info::cas_slow_log_reset, cas_unlink(), t_appl_server_info::cur_slow_log_mode, NULL, slow_log_filepath, slow_log_fp, and SLOW_LOG_MODE_OFF.
Referenced by fn_end_tran(), net_read_int_keep_con_auto(), and process_request().
void cas_slow_log_write | ( | struct timeval * | log_time, |
unsigned int | seq_num, | ||
bool | unit_start, | ||
const char * | fmt, | ||
... | |||
) |
Definition at line 1085 of file cas_log.c.
References as_info, t_shm_appl_server::broker_name, cas_log_write_internal(), cas_slow_log_open(), t_appl_server_info::cur_slow_log_mode, NULL, shm_appl, slow_log_fp, and SLOW_LOG_MODE_OFF.
Referenced by bind_value_log(), fn_execute_array(), and fn_execute_internal().
void cas_slow_log_write2 | ( | const char * | fmt, |
... | |||
) |
Definition at line 1105 of file cas_log.c.
References as_info, t_shm_appl_server::broker_name, cas_log_write2_internal(), cas_slow_log_open(), t_appl_server_info::cur_slow_log_mode, NULL, shm_appl, slow_log_fp, and SLOW_LOG_MODE_OFF.
Referenced by bind_value_log(), and bind_value_print().
void cas_slow_log_write_and_end | ( | struct timeval * | log_time, |
unsigned int | seq_num, | ||
const char * | fmt, | ||
... | |||
) |
Definition at line 1062 of file cas_log.c.
References as_info, t_shm_appl_server::broker_name, cas_log_write_internal(), cas_slow_log_end(), cas_slow_log_open(), t_appl_server_info::cur_slow_log_mode, NULL, shm_appl, slow_log_fp, and SLOW_LOG_MODE_OFF.
Referenced by cas_main().
void cas_slow_log_write_query_string | ( | char * | query, |
int | size | ||
) |
Definition at line 1141 of file cas_log.c.
References as_info, t_shm_appl_server::broker_name, cas_fputc(), cas_slow_log_open(), t_appl_server_info::cur_slow_log_mode, NULL, shm_appl, slow_log_fp, and SLOW_LOG_MODE_OFF.
Referenced by fn_execute_array(), and fn_execute_internal().
void cas_slow_log_write_value_string | ( | char * | value, |
int | size | ||
) |
Definition at line 1125 of file cas_log.c.
References as_info, t_shm_appl_server::broker_name, cas_fwrite(), cas_slow_log_open(), t_appl_server_info::cur_slow_log_mode, NULL, shm_appl, slow_log_fp, and SLOW_LOG_MODE_OFF.
Referenced by bind_value_print().