Closed disprosium8 closed 8 years ago
Hi @disprosium8 - It looks good. My one suggestion would be:
Also, by "one suggestion", I mean "I can't count"
What even gets written to that log? It was just hardcoded to ibp_activity.log in the CWD, but it just seems to contain a copy of the running config.
I'm not 100% sure, the log is initialized with:
https://github.com/datalogistics/ibp_server/blob/master/ibp_server.c#L403 https://github.com/datalogistics/ibp_server/blob/master/ibp_server.c#L368
server->logfile = inip_get_string(keyfile, "server", "log_file", server->logfile);
server->log_level = inip_get_integer(keyfile, "server", "log_level", server->log_level);
server->log_maxsize = inip_get_integer(keyfile, "server", "log_maxsize", server->log_maxsize) * 1024 * 1024;
server->debug_level = inip_get_integer(keyfile, "server", "debug_level", server->debug_level);
// SNIP
open_log(cfg->server.logfile);
set_log_level(cfg->server.log_level);
set_debug_level(cfg->server.debug_level);
set_log_maxsize(cfg->server.log_maxsize);
@tacketar Which log matters?
I'd say change the defaults to /var/log/
There are 2 log files and neither of them have hard coded paths. Both are configurable in the config file. The activity log(ibp_activity.log) logs all the IBP operations and responses and needs print_alog to parse it. The other has all the log_printf() output, ibp.log. The activity log is controlled by the "activity_file" option and the other by "log_file" option in the "server" section of the configuration file.
Alan
On 12/9/2015 11:43 AM, Andrew Melo wrote:
I'm not 100% sure, the log is initialized with:
https://github.com/datalogistics/ibp_server/blob/master/ibp_server.c#L403 https://github.com/datalogistics/ibp_server/blob/master/ibp_server.c#L368
server->logfile = inip_get_string(keyfile,"server","log_file", server->logfile); server->log_level = inip_get_integer(keyfile,"server","log_level", server->log_level); server->log_maxsize = inip_get_integer(keyfile,"server","log_maxsize", server->log_maxsize) 1024 1024; server->debug_level = inip_get_integer(keyfile,"server","debug_level", server->debug_level); // SNIP open_log(cfg->server.logfile); set_log_level(cfg->server.log_level); set_debug_level(cfg->server.debug_level); set_log_maxsize(cfg->server.log_maxsize);
@tacketar https://github.com/tacketar Which log matters?
I'd say change the defaults to /var/log/, then we can sort out what doesn't matter. Let me trace down what logs go where real quick.
— Reply to this email directly or view it on GitHub https://github.com/datalogistics/ibp_server/pull/23#issuecomment-163336180.
Last call for comments before I merge this change. Tested it as RPM and with source install. Previous behavior is maintained by setting user/group to whatever user you would ordinarily start the service with. As a daemon, the process will write a PID file to /var/run unless otherwise specified.
Any potential issues with this request?