Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 54385 invoked from network); 30 Mar 2006 11:02:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Mar 2006 11:02:01 -0000 Received: (qmail 98962 invoked by uid 500); 30 Mar 2006 11:01:54 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 98869 invoked by uid 500); 30 Mar 2006 11:01:53 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 98858 invoked by uid 500); 30 Mar 2006 11:01:53 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 98855 invoked by uid 99); 30 Mar 2006 11:01:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Mar 2006 03:01:53 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 30 Mar 2006 03:01:52 -0800 Received: (qmail 54020 invoked by uid 65534); 30 Mar 2006 11:01:32 -0000 Message-ID: <20060330110132.54018.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r390082 - in /webservices/axis2/trunk/c: INSTALL modules/core/transport/http/server/apache2/mod_axis2.c Date: Thu, 30 Mar 2006 11:01:31 -0000 To: axis2-cvs@ws.apache.org From: sahan@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sahan Date: Thu Mar 30 03:01:29 2006 New Revision: 390082 URL: http://svn.apache.org/viewcvs?rev=390082&view=rev Log: Adding a directive to apache module to specify log level. Updating INSTALL file Modified: webservices/axis2/trunk/c/INSTALL webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c Modified: webservices/axis2/trunk/c/INSTALL URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/INSTALL?rev=390082&r1=390081&r2=390082&view=diff ============================================================================== --- webservices/axis2/trunk/c/INSTALL (original) +++ webservices/axis2/trunk/c/INSTALL Thu Mar 30 03:01:29 2006 @@ -262,8 +262,15 @@ SetHandler axis2_module RepoPath LogFile + Axis2LogLevel LOG_LEVEL - +* LOG_LEVEL can be one of following + AXIS2_LOG_LEVEL_CRITICAL - Log critical errors only + AXIS2_LOG_LEVEL_ERROR - Log errors critical errors + AXIS2_LOG_LEVEL_WARNING - Log warnings and above + AXIS2_LOG_LEVEL_INFO - Log info and above + AXIS2_LOG_LEVEL_DEBUG - Log debug and above (default) + AXIS2_LOG_LEVEL_TRACE - Log trace messages * Make sure that the apache2 user has correct permissions to above paths - Read permission to the repository - Write permission to the log file Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c?rev=390082&r1=390081&r2=390082&view=diff ============================================================================== --- webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c (original) +++ webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c Thu Mar 30 03:01:29 2006 @@ -31,6 +31,7 @@ { char * axis2_log_file; char * axis2_repo_path; + axis2_log_levels_t log_level; }axis2_config_rec_t; axis2_apache2_worker_t *axis2_worker = NULL; @@ -42,6 +43,8 @@ const char *arg); static const char *axis2_set_log_file(cmd_parms *cmd, void *dummy, const char *arg); +static const char *axis2_set_log_level(cmd_parms *cmd, void *dummy, + const char *arg); static int axis2_handler(request_rec *req); static void axis2_module_init(apr_pool_t* p, server_rec* svr_rec); static void axis2_register_hooks(apr_pool_t *p); @@ -53,6 +56,8 @@ "Axis2/C repository path"), AP_INIT_TAKE1("LogFile", axis2_set_log_file, NULL, ACCESS_CONF, "Axis2/C log file name"), + AP_INIT_TAKE1("Axis2LogLevel", axis2_set_log_level, NULL, ACCESS_CONF, + "Axis2/C log level"), {NULL} }; @@ -72,6 +77,7 @@ axis2_config_rec_t *conf = apr_palloc(p, sizeof(*conf)); conf->axis2_log_file = NULL; conf->axis2_repo_path = NULL; + conf->log_level = AXIS2_LOG_LEVEL_DEBUG; /* We need to init xml readers before we go into threaded env */ axis2_xml_reader_init(); @@ -96,6 +102,44 @@ return NULL; } +static const char *axis2_set_log_level(cmd_parms *cmd, void *dummy, + const char *arg) +{ + axis2_log_levels_t level = AXIS2_LOG_LEVEL_DEBUG; + axis2_config_rec_t *conf = (axis2_config_rec_t*)ap_get_module_config( + cmd->server->module_config, &axis2_module); + + if(NULL != arg) + { + if(!apr_strnatcmp(arg, "AXIS2_LOG_LEVEL_DEBUG")) + { + level = AXIS2_LOG_LEVEL_DEBUG; + } + else if(!apr_strnatcmp(arg,"AXIS2_LOG_LEVEL_CRITICAL")) + { + level = AXIS2_LOG_LEVEL_CRITICAL; + } + else if(!apr_strnatcmp(arg,"AXIS2_LOG_LEVEL_ERROR")) + { + level = AXIS2_LOG_LEVEL_ERROR; + } + else if(!apr_strnatcmp(arg,"AXIS2_LOG_LEVEL_WARNING")) + { + level = AXIS2_LOG_LEVEL_WARNING; + } + else if(!apr_strnatcmp(arg,"AXIS2_LOG_LEVEL_INFO")) + { + level = AXIS2_LOG_LEVEL_INFO; + } + else if(!apr_strnatcmp(arg,"AXIS2_LOG_LEVEL_TRACE")) + { + level = AXIS2_LOG_LEVEL_TRACE; + } + } + conf->log_level = level; + return NULL; +} + /* The sample content handler */ static int axis2_handler(request_rec *req) { @@ -150,6 +194,7 @@ "log init failed\n"); status = AXIS2_FAILURE; } + axis2_logger->level = conf->log_level; thread_pool = axis2_thread_pool_init(allocator); if(NULL == thread_pool) { @@ -165,6 +210,8 @@ "axis2_environment init failed\n"); status = AXIS2_FAILURE; } + AXIS2_LOG_INFO(axis2_env->log, "Starting log with log level %d", + conf->log_level); axis2_worker = axis2_apache2_worker_create(&axis2_env, conf->axis2_repo_path); if(NULL == axis2_worker)