You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by ra...@apache.org on 2001/03/20 16:43:36 UTC

cvs commit: jakarta-turbine/src/java/org/apache/turbine/services/schedule WorkerThread.java

rafal       01/03/20 07:43:32

  Modified:    conf     TurbineResources.properties
               conf/master TurbineResources.master
               src/java/org/apache/turbine/services/schedule
                        WorkerThread.java
  Log:
  nicer logging of ScheduledJob execution
  
  Revision  Changes    Path
  1.74      +8 -1      jakarta-turbine/conf/TurbineResources.properties
  
  Index: TurbineResources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/conf/TurbineResources.properties,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- TurbineResources.properties	2001/03/18 16:37:33	1.73
  +++ TurbineResources.properties	2001/03/20 15:43:03	1.74
  @@ -1,5 +1,5 @@
   # -------------------------------------------------------------------
  -# $Id: TurbineResources.properties,v 1.73 2001/03/18 16:37:33 jvanzyl Exp $
  +# $Id: TurbineResources.properties,v 1.74 2001/03/20 15:43:03 rafal Exp $
   #
   # This is the configuration file for Turbine.
   #
  @@ -27,6 +27,13 @@
   services.TurbineLoggingService.system.destination.file=/logs/turbine.log
   services.TurbineLoggingService.system.className=org.apache.turbine.services.logging.FileLogger
   services.TurbineLoggingService.system.level=INFO
  +
  +# A facitly for the scheduler service
  +# To disable started/stopped messages set the level to ERROR
  +services.TurbineLoggingService.scheduler.destitnation.file=/logs/turbine.log
  +services.TurbineLoggingService.scheduler.className=org.apache.turbine.services.logging.FileLogger
  +services.TurbineLoggingService.scheduler.level=INFO
  +
   
   # A facility for debugging applications. Messages will go both
   # to the log file and the server console.
  
  
  
  1.40      +8 -1      jakarta-turbine/conf/master/TurbineResources.master
  
  Index: TurbineResources.master
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/conf/master/TurbineResources.master,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- TurbineResources.master	2001/03/18 16:37:33	1.39
  +++ TurbineResources.master	2001/03/20 15:43:14	1.40
  @@ -1,5 +1,5 @@
   # -------------------------------------------------------------------
  -# $Id: TurbineResources.master,v 1.39 2001/03/18 16:37:33 jvanzyl Exp $
  +# $Id: TurbineResources.master,v 1.40 2001/03/20 15:43:14 rafal Exp $
   #
   # This is the configuration file for Turbine.
   #
  @@ -27,6 +27,13 @@
   services.TurbineLoggingService.system.destination.file=@TURBINE_LOG@
   services.TurbineLoggingService.system.className=org.apache.turbine.services.logging.FileLogger
   services.TurbineLoggingService.system.level=INFO
  +
  +# A facitly for the scheduler service
  +# To disable started/stopped messages set the level to ERROR
  +services.TurbineLoggingService.scheduler.destitnation.file=@TURBINE_LOG@
  +services.TurbineLoggingService.scheduler.className=org.apache.turbine.services.logging.FileLogger
  +services.TurbineLoggingService.scheduler.level=INFO
  +
   
   # A facility for debugging applications. Messages will go both
   # to the log file and the server console.
  
  
  
  1.16      +14 -7     jakarta-turbine/src/java/org/apache/turbine/services/schedule/WorkerThread.java
  
  Index: WorkerThread.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/schedule/WorkerThread.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- WorkerThread.java	2001/03/06 06:12:44	1.15
  +++ WorkerThread.java	2001/03/20 15:43:24	1.16
  @@ -70,7 +70,7 @@
    *
    * @author <a href="mailto:mbryson@mont.mindspring.com">Dave Bryson</a>
    * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
  - * @version $Id: WorkerThread.java,v 1.15 2001/03/06 06:12:44 chrise Exp $
  + * @version $Id: WorkerThread.java,v 1.16 2001/03/20 15:43:24 rafal Exp $
    */
   public class WorkerThread
       implements Runnable
  @@ -81,6 +81,11 @@
       private JobEntry je = null;
   
       /**
  +     * The {@link org.apache.turbine.services.logging.Logger} facility to use.
  +     */
  +    private Logger logger = null;
  +
  +    /**
        * Creates a new worker to run the specified <code>JobEntry</code>.
        *
        * @param je The <code>JobEntry</code> to create a worker for.
  @@ -88,6 +93,7 @@
       public WorkerThread(JobEntry je)
       {
           this.je = je;
  +        logger = TurbineLogging.getLogger("scheduler");
       }
   
       /**
  @@ -103,20 +109,21 @@
               if (! je.isActive())
               {
                   je.setActive(true);
  -                logJobEntryStateChange("started");
  +                logStateChange("started");
                   ScheduledJobLoader.getInstance().exec(je, je.getTask());
               }
           }
           catch (Exception e)
           {
  -            Log.error("Error in WorkerThread for Task: " + je.getTask(), e);
  +            logger.error("Error in WorkerThread for sheduled job #" + 
  +                         je.getPrimaryKey() + ", task: " + je.getTask(), e);
           }
           finally
           {
               if (je.isActive())
               {
                   je.setActive(false);
  -                logJobEntryStateChange("completed");
  +                logStateChange("completed");
               }
           }
       }
  @@ -126,9 +133,9 @@
        *
        * @param state The new state of the <code>JobEntry</code>.
        */
  -    private final void logJobEntryStateChange(String state)
  +    private final void logStateChange(String state)
       {
  -        Log.debug("Scheduled job " + je.getPrimaryKey() + ' ' + state +
  -                  " task " + je.getTask() + " on " + new Date());
  +        logger.debug("Scheduled job #" + je.getPrimaryKey() + ' ' + state + 
  +                 ", task: " + je.getTask());
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: cvs commit: jakarta-turbine/src/java/org/apache/turbine/services/schedule WorkerThread.java

Posted by Rafal Krzewski <Ra...@e-point.pl>.
"Randall G. Alley" wrote:
 
> I just did a build and got an error during the compile of:
> WorkerThread.java, unable to find Logger.java
> 
> I included the following to get Turbine to finish compiling.
> 
> import org.apache.turbine.services.logging.*;

OK, Actually it was Ilkka who fixed that. Thanks...

jakarta.apache.org gives me a lot of trouble. My connection to it
is so bad that my cvs clied timed out twice trying to checkin
the fix...

Rafal

--
Rafal Krzewski
Senior Internet Developer
mailto:Rafal.Krzewski@e-point.pl
+48 22 8534830 http://e-point.pl

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


HttpUtils, sorry about the tabs

Posted by Magnus ?or Torfason <ma...@handtolvur.is>.
Jon, sorry about the tabs in my last post.  Won't happen again.

Magnus

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: cvs commit: jakarta-turbine/src/java/org/apache/turbine/services/schedule WorkerThread.java

Posted by Daniel Rall <dl...@collab.net>.
"Randall G. Alley" <ir...@bellsouth.net> writes:

> Rafal,
> 
> I just did a build and got an error during the compile of:
> WorkerThread.java, unable to find Logger.java
> 
> I included the following to get Turbine to finish compiling.
> 
> import org.apache.turbine.services.logging.*;
> 
> Is this right ?

Thanks Randall, looks like Ilkka got it.

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: cvs commit: jakarta-turbine/src/java/org/apache/turbine/services/schedule WorkerThread.java

Posted by Rafal Krzewski <Ra...@e-point.pl>.
"Randall G. Alley" wrote:

> I just did a build and got an error during the compile of:
> WorkerThread.java, unable to find Logger.java
> 
> I included the following to get Turbine to finish compiling.
> 
> import org.apache.turbine.services.logging.*;
> 
> Is this right ?

Sorry for that guys. I made the change on our local fozen copy of
Turbine,
and then applied the changes to my CVS snapshot, and a bit was lost in
the 
process. I fixed it already.

Rafal

--
Rafal Krzewski
Senior Internet Developer
mailto:Rafal.Krzewski@e-point.pl
+48 22 8534830 http://e-point.pl

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: cvs commit: jakarta-turbine/src/java/org/apache/turbine/services/schedule WorkerThread.java

Posted by "Randall G. Alley" <ir...@bellsouth.net>.
Rafal,

I just did a build and got an error during the compile of:
WorkerThread.java, unable to find Logger.java

I included the following to get Turbine to finish compiling.

import org.apache.turbine.services.logging.*;

Is this right ?

Thanks,
Randy

rafal@apache.org wrote:

> rafal       01/03/20 07:43:32
>
>   Modified:    conf     TurbineResources.properties
>                conf/master TurbineResources.master
>                src/java/org/apache/turbine/services/schedule
>                         WorkerThread.java
>   Log:
>   nicer logging of ScheduledJob execution
>
>   Revision  Changes    Path
>   1.74      +8 -1      jakarta-turbine/conf/TurbineResources.properties
>
>   Index: TurbineResources.properties
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine/conf/TurbineResources.properties,v
>   retrieving revision 1.73
>   retrieving revision 1.74
>   diff -u -r1.73 -r1.74
>   --- TurbineResources.properties       2001/03/18 16:37:33     1.73
>   +++ TurbineResources.properties       2001/03/20 15:43:03     1.74
>   @@ -1,5 +1,5 @@
>    # -------------------------------------------------------------------
>   -# $Id: TurbineResources.properties,v 1.73 2001/03/18 16:37:33 jvanzyl Exp $
>   +# $Id: TurbineResources.properties,v 1.74 2001/03/20 15:43:03 rafal Exp $
>    #
>    # This is the configuration file for Turbine.
>    #
>   @@ -27,6 +27,13 @@
>    services.TurbineLoggingService.system.destination.file=/logs/turbine.log
>    services.TurbineLoggingService.system.className=org.apache.turbine.services.logging.FileLogger
>    services.TurbineLoggingService.system.level=INFO
>   +
>   +# A facitly for the scheduler service
>   +# To disable started/stopped messages set the level to ERROR
>   +services.TurbineLoggingService.scheduler.destitnation.file=/logs/turbine.log
>   +services.TurbineLoggingService.scheduler.className=org.apache.turbine.services.logging.FileLogger
>   +services.TurbineLoggingService.scheduler.level=INFO
>   +
>
>    # A facility for debugging applications. Messages will go both
>    # to the log file and the server console.
>
>
>
>   1.40      +8 -1      jakarta-turbine/conf/master/TurbineResources.master
>
>   Index: TurbineResources.master
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine/conf/master/TurbineResources.master,v
>   retrieving revision 1.39
>   retrieving revision 1.40
>   diff -u -r1.39 -r1.40
>   --- TurbineResources.master   2001/03/18 16:37:33     1.39
>   +++ TurbineResources.master   2001/03/20 15:43:14     1.40
>   @@ -1,5 +1,5 @@
>    # -------------------------------------------------------------------
>   -# $Id: TurbineResources.master,v 1.39 2001/03/18 16:37:33 jvanzyl Exp $
>   +# $Id: TurbineResources.master,v 1.40 2001/03/20 15:43:14 rafal Exp $
>    #
>    # This is the configuration file for Turbine.
>    #
>   @@ -27,6 +27,13 @@
>    services.TurbineLoggingService.system.destination.file=@TURBINE_LOG@
>    services.TurbineLoggingService.system.className=org.apache.turbine.services.logging.FileLogger
>    services.TurbineLoggingService.system.level=INFO
>   +
>   +# A facitly for the scheduler service
>   +# To disable started/stopped messages set the level to ERROR
>   +services.TurbineLoggingService.scheduler.destitnation.file=@TURBINE_LOG@
>   +services.TurbineLoggingService.scheduler.className=org.apache.turbine.services.logging.FileLogger
>   +services.TurbineLoggingService.scheduler.level=INFO
>   +
>
>    # A facility for debugging applications. Messages will go both
>    # to the log file and the server console.
>
>
>
>   1.16      +14 -7     jakarta-turbine/src/java/org/apache/turbine/services/schedule/WorkerThread.java
>
>   Index: WorkerThread.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/schedule/WorkerThread.java,v
>   retrieving revision 1.15
>   retrieving revision 1.16
>   diff -u -r1.15 -r1.16
>   --- WorkerThread.java 2001/03/06 06:12:44     1.15
>   +++ WorkerThread.java 2001/03/20 15:43:24     1.16
>   @@ -70,7 +70,7 @@
>     *
>     * @author <a href="mailto:mbryson@mont.mindspring.com">Dave Bryson</a>
>     * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
>   - * @version $Id: WorkerThread.java,v 1.15 2001/03/06 06:12:44 chrise Exp $
>   + * @version $Id: WorkerThread.java,v 1.16 2001/03/20 15:43:24 rafal Exp $
>     */
>    public class WorkerThread
>        implements Runnable
>   @@ -81,6 +81,11 @@
>        private JobEntry je = null;
>
>        /**
>   +     * The {@link org.apache.turbine.services.logging.Logger} facility to use.
>   +     */
>   +    private Logger logger = null;
>   +
>   +    /**
>         * Creates a new worker to run the specified <code>JobEntry</code>.
>         *
>         * @param je The <code>JobEntry</code> to create a worker for.
>   @@ -88,6 +93,7 @@
>        public WorkerThread(JobEntry je)
>        {
>            this.je = je;
>   +        logger = TurbineLogging.getLogger("scheduler");
>        }
>
>        /**
>   @@ -103,20 +109,21 @@
>                if (! je.isActive())
>                {
>                    je.setActive(true);
>   -                logJobEntryStateChange("started");
>   +                logStateChange("started");
>                    ScheduledJobLoader.getInstance().exec(je, je.getTask());
>                }
>            }
>            catch (Exception e)
>            {
>   -            Log.error("Error in WorkerThread for Task: " + je.getTask(), e);
>   +            logger.error("Error in WorkerThread for sheduled job #" +
>   +                         je.getPrimaryKey() + ", task: " + je.getTask(), e);
>            }
>            finally
>            {
>                if (je.isActive())
>                {
>                    je.setActive(false);
>   -                logJobEntryStateChange("completed");
>   +                logStateChange("completed");
>                }
>            }
>        }
>   @@ -126,9 +133,9 @@
>         *
>         * @param state The new state of the <code>JobEntry</code>.
>         */
>   -    private final void logJobEntryStateChange(String state)
>   +    private final void logStateChange(String state)
>        {
>   -        Log.debug("Scheduled job " + je.getPrimaryKey() + ' ' + state +
>   -                  " task " + je.getTask() + " on " + new Date());
>   +        logger.debug("Scheduled job #" + je.getPrimaryKey() + ' ' + state +
>   +                 ", task: " + je.getTask());
>        }
>    }
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org