Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.6.0
-
Binary distribution of Axis2C (1.6.0) deployed on WindowsXP2002/SP3
Description
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.