costin 02/03/18 20:53:40 Modified: jk/native2/common jk_config.c jk_logger_file.c jk_map.c jk_pool.c Log: - logger.file property will set the file and open it ( and close the previous one). - fix ending in pstrdup() Revision Changes Path 1.2 +2 -2 jakarta-tomcat-connectors/jk/native2/common/jk_config.c Index: jk_config.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_config.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_config.c 18 Mar 2002 18:26:15 -0000 1.1 +++ jk_config.c 19 Mar 2002 04:53:40 -0000 1.2 @@ -58,7 +58,7 @@ /*************************************************************************** * Description: General purpose config object * * Author: Gal Shachor <[EMAIL PROTECTED]> * - * Version: $Revision: 1.1 $ * + * Version: $Revision: 1.2 $ * ***************************************************************************/ #include "jk_global.h" @@ -247,7 +247,7 @@ if( w != NULL ) { /* If we have an object with that name, set the prop */ env->l->jkLog(env, env->l, JK_LOG_INFO, - "Setting %s %s %s\n", objName, propName, val); + "Setting %s %s=%s\n", objName, propName, val); if( w->setAttribute != NULL ) return w->setAttribute( env, w, propName, val ); 1.13 +15 -9 jakarta-tomcat-connectors/jk/native2/common/jk_logger_file.c Index: jk_logger_file.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_logger_file.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- jk_logger_file.c 18 Mar 2002 18:38:39 -0000 1.12 +++ jk_logger_file.c 19 Mar 2002 04:53:40 -0000 1.13 @@ -59,7 +59,7 @@ * Description: Utility functions (mainly configuration) * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Author: Henri Gomez <[EMAIL PROTECTED]> * - * Version: $Revision: 1.12 $ * + * Version: $Revision: 1.13 $ * ***************************************************************************/ #include "jk_env.h" @@ -150,6 +150,11 @@ char *value=valueP; if( strcmp( name, "name" )==0 ) { _this->name=(char *)value; + } else if( strcmp( name, "file" )==0 ) { + _this->name=(char *)value; + /* Set the file imediately */ + jk2_logger_file_init(env, (jk_logger_t *)mbean->object ); + } else if( strcmp( name, "timeFormat" )==0 ) { jk2_logger_file_logFmt = value; } else if( strcmp( name, "level" )==0 ) { @@ -164,25 +169,24 @@ static int jk2_logger_file_init(jk_env_t *env,jk_logger_t *_this ) { - FILE *f; + FILE *oldF=(FILE *)_this->logger_private; + FILE *f=NULL; if( _this->name==NULL ) _this->name="mod_jk.log"; - if( _this->level == 0 ) - _this->level=JK_LOG_ERROR_LEVEL; - - if( jk2_logger_file_logFmt==NULL ) { - jk2_logger_file_logFmt = JK_TIME_FORMAT; - } - f = fopen(_this->name, "a+"); if(f==NULL) { _this->jkLog(env, _this,JK_LOG_ERROR, "Can't open log file %s\n", _this->name ); return JK_FALSE; } + _this->jkLog(env, _this,JK_LOG_ERROR, + "Initilizing log file %s\n", _this->name ); _this->logger_private = f; + if( oldF!=NULL ) { + fclose( oldF ); + } return JK_TRUE; } @@ -290,6 +294,8 @@ l->init =jk2_logger_file_init; l->jkLog = jk2_logger_file_jkLog; l->level=JK_LOG_ERROR_LEVEL; + jk2_logger_file_logFmt = JK_TIME_FORMAT; + result->object=l; l->mbean=result; 1.16 +1 -2 jakarta-tomcat-connectors/jk/native2/common/jk_map.c Index: jk_map.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_map.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- jk_map.c 18 Mar 2002 18:42:50 -0000 1.15 +++ jk_map.c 19 Mar 2002 04:53:40 -0000 1.16 @@ -58,7 +58,7 @@ /*************************************************************************** * Description: General purpose map object * * Author: Gal Shachor <[EMAIL PROTECTED]> * - * Version: $Revision: 1.15 $ * + * Version: $Revision: 1.16 $ * ***************************************************************************/ #include "jk_global.h" @@ -137,7 +137,6 @@ mPriv->names[mPriv->size] = (char *)name; */ mPriv->names[mPriv->size] = m->pool->pstrdup(env,m->pool, name); - /* fprintf(stderr, "jk_map.set %s %s \n", name, value ); */ mPriv->size ++; rc = JK_TRUE; } 1.7 +2 -1 jakarta-tomcat-connectors/jk/native2/common/jk_pool.c Index: jk_pool.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_pool.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jk_pool.c 21 Feb 2002 11:12:11 -0000 1.6 +++ jk_pool.c 19 Mar 2002 04:53:40 -0000 1.7 @@ -58,7 +58,7 @@ /*************************************************************************** * Description: Simple memory pool * * Author: Gal Shachor <[EMAIL PROTECTED]> * - * Version: $Revision: 1.6 $ * + * Version: $Revision: 1.7 $ * ***************************************************************************/ #include "jk_pool.h" @@ -264,6 +264,7 @@ if(rc) { memcpy(rc, s, size); } + rc[size]='\0'; } return rc;
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>