mturk       2002/10/04 09:08:19

  Modified:    jk/native2/common jk_logger_file.c
  Log:
  1. Change the default logger to the jk2.log (was mod_jk.log)
  2. Fix the ${serverRoot} replaceProperties.
  3. Do not close log file if it is stderr.
  
  Revision  Changes    Path
  1.35      +8 -7      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.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- jk_logger_file.c  27 Sep 2002 13:08:17 -0000      1.34
  +++ jk_logger_file.c  4 Oct 2002 16:08:19 -0000       1.35
  @@ -153,11 +153,11 @@
       FILE *f=NULL;
       jk_workerEnv_t *workerEnv=env->getByName( env, "workerEnv" );
       if( _this->name==NULL ) {
  -        _this->name="${serverRoot}/logs/mod_jk.log";
  +        _this->name="${serverRoot}/logs/jk2.log";
       }
  -    jk2_config_replaceProperties( env, workerEnv->initData,
  -                                                  _this->mbean->pool,_this->name);
  -    if( strcmp( "stderr", _this->name )==0 ) {
  +    _this->name = jk2_config_replaceProperties(env, workerEnv->initData,
  +                                               _this->mbean->pool, _this->name);
  +    if( !_this->name || strcmp( "stderr", _this->name )==0 ) {
           _this->logger_private = stderr;
       } else {
       
  @@ -176,7 +176,7 @@
       } 
       _this->jkLog(env, _this,JK_LOG_INFO,
                    "Initializing log file %s\n", _this->name );
  -    if( oldF!=NULL ) {
  +    if( oldF!=NULL && oldF != stderr) {
           fclose( oldF );
       }
       return JK_OK;
  @@ -185,7 +185,8 @@
   static int jk2_logger_file_close(jk_env_t *env,jk_logger_t *_this)
   {
       FILE *f = _this->logger_private;
  -    if( f==NULL ) return JK_OK;
  +    if (f == NULL || f != stderr)
  +        return JK_OK;
       
       fflush(f);
       fclose(f);
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to