Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1460

Enable/disable logging at runtime

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.6.0
    • 1.7.0
    • util
    • 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.

      Attachments

        1. AXIS2C-1460-log_enabled.patch
          2 kB
          Olivier Mengué

        Activity

          People

            Unassigned Unassigned
            bojan Bojan Smojver
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: