Enable/disable logging at runtime
---------------------------------
Key: AXIS2C-1460
URL: https://issues.apache.org/jira/browse/AXIS2C-1460
Project: Axis2-C
Issue Type: Bug
Components: util
Affects Versions: 1.6.0
Environment: Binary distribution of Axis2C (1.6.0) deployed on
WindowsXP2002/SP3
Reporter: Bojan Komazec
Priority: Minor
Function axutil_env_enable_log sets
env->log_enabled
but
env->log->enabled
is tested in functions that write to file (like axutil_log_impl_log_debug).
Disabling logging via axutil_env_enable_log actually does not affect logging.
Example code:
axutil_env_t* env = axutil_env_create_all(szLogFilePath,
AXIS2_LOG_LEVEL_TRACE);
// logging is enabled by default
AXIS2_LOG_DEBUG_MSG(env->log, "test 1"); // appears in log file
if(axutil_env_enable_log(env, AXIS2_FALSE) != AXIS2_SUCCESS)
{
// handle error
}
AXIS2_LOG_DEBUG_MSG(env->log, "test 2"); // appears in log file
Using
env->log->enabled = AXIS2_FALSE;
instead of
axutil_env_enable_log(env, AXIS2_FALSE);
does the job.
axutil_env_enable_log should maybe set axutil_log's member :
env->log->enabled = enable;
I think that keeping the same information ("Is logging enabled") both in
axutil_env and axutil_log structures introduces redundancy.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]