You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2006/02/27 08:58:19 UTC
svn commit: r381285 - /webservices/axis2/trunk/c/modules/util/log.c
Author: samisa
Date: Sun Feb 26 23:58:18 2006
New Revision: 381285
URL: http://svn.apache.org/viewcvs?rev=381285&view=rev
Log:
Fixed to enable redirection of log to std out/err
Modified:
webservices/axis2/trunk/c/modules/util/log.c
Modified: webservices/axis2/trunk/c/modules/util/log.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/log.c?rev=381285&r1=381284&r2=381285&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/log.c (original)
+++ webservices/axis2/trunk/c/modules/util/log.c Sun Feb 26 23:58:18 2006
@@ -108,25 +108,32 @@
/* we write all logs to AXIS2C_HOME/logs if it is set otherwise
* to the working dir
*/
- if (NULL != (path_home = AXIS2_GETENV("AXIS2C_HOME")))
+ if (stream_name && !(AXIS2_RINDEX(stream_name, AXIS2_PATH_SEP_CHAR)))
{
- AXIS2_SNPRINTF(log_dir, 500, "%s%c%s", path_home, AXIS2_PATH_SEP_CHAR, "logs");
- if (AXIS2_SUCCESS == axis2_file_handler_access(log_dir,AXIS2_F_OK))
- {
- AXIS2_SNPRINTF(log_file_name, 500, "%s%c%s", log_dir, AXIS2_PATH_SEP_CHAR,
- tmp_filename);
- }
- else
- {
- fprintf(stderr, "log folder %s does not exist - log file %s is written to . dir\n",
- log_dir, tmp_filename);
- AXIS2_SNPRINTF(log_file_name, 500, "%s", tmp_filename);
- }
+ if (NULL != (path_home = AXIS2_GETENV("AXIS2C_HOME")))
+ {
+ AXIS2_SNPRINTF(log_dir, 500, "%s%c%s", path_home, AXIS2_PATH_SEP_CHAR, "logs");
+ if (AXIS2_SUCCESS == axis2_file_handler_access(log_dir,AXIS2_F_OK))
+ {
+ AXIS2_SNPRINTF(log_file_name, 500, "%s%c%s", log_dir, AXIS2_PATH_SEP_CHAR,
+ tmp_filename);
+ }
+ else
+ {
+ fprintf(stderr, "log folder %s does not exist - log file %s is written to . dir\n",
+ log_dir, tmp_filename);
+ AXIS2_SNPRINTF(log_file_name, 500, "%s", tmp_filename);
+ }
+ }
+ else
+ {
+ fprintf(stderr, "AXIS2C_HOME is not set - log is written to . dir\n");
+ AXIS2_SNPRINTF(log_file_name, 500, "%s", tmp_filename);
+ }
}
else
{
- fprintf(stderr, "AXIS2C_HOME is not set - log is written to . dir\n");
- AXIS2_SNPRINTF(log_file_name, 500, "%s", tmp_filename);
+ AXIS2_SNPRINTF(log_file_name, 500, "%s", tmp_filename);
}
axis2_thread_mutex_lock(log_impl->mutex);