Exemple #1
0
int mod_register(char *path, int *dlflags, void *p1, void *p2)
{
	if(_km_log_engine_type==0)
		return 0;

	if(strcasecmp(_km_log_engine_type, "systemd")!=0)
		return 0;

	km_log_func_set(&_lc_core_log_systemd);
	_lc_log_systemd = 1;
	return 0;
}
Exemple #2
0
/**
 * @brief Initialize module children
 */
static int child_init(int rank)
{
	if(rank!=PROC_INIT)
		return 0;

	_lc_udp_dst.proto = PROTO_UDP;
	_lc_udp_dst.send_sock=get_send_socket(NULL, &_lc_udp_dst.to, PROTO_UDP);
	if (_lc_udp_dst.send_sock==0) {
		_lc_udp_dst.send_sock = get_out_socket(&_lc_udp_dst.to, PROTO_UDP);
		if (_lc_udp_dst.send_sock==0) {
			LM_ERR("failed to get send socket\n");
			return -1;
		}
	}
	LM_DBG("setting udp-send custom logging function\n");
	km_log_func_set(&_lc_core_log_udp);
	_lc_log_udp = 1;



	return 0;
}