You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Ralph Goers <ra...@dslextreme.com> on 2015/11/17 04:25:58 UTC

LOG4J2-89

I have checked in a CronTriggeringPolicy for the RollingFileAppenders on branch LOG4J2-89.  It also introduces the ConfigurationScheduler, a more generic version of the ScheduledExecutorService I previously added. I am envisioning that the scheduler can be used for more time-based tasks. Plugins that use the Scheduler should be annotated with the Scheduled annotation to help calculate the number of threads the scheduler should create.

Please take a look at the branch and let me know what you think.

Ralph

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


Re: LOG4J2-89

Posted by Remko Popma <re...@gmail.com>.
No objections from me.
Remko 

Sent from my iPhone

> On 2015/11/20, at 9:41, Ralph Goers <ra...@dslextreme.com> wrote:
> 
> Any objections with me merging this to master?
> 
> Ralph
> 
>> On Nov 16, 2015, at 8:25 PM, Ralph Goers <ra...@dslextreme.com> wrote:
>> 
>> I have checked in a CronTriggeringPolicy for the RollingFileAppenders on branch LOG4J2-89.  It also introduces the ConfigurationScheduler, a more generic version of the ScheduledExecutorService I previously added. I am envisioning that the scheduler can be used for more time-based tasks. Plugins that use the Scheduler should be annotated with the Scheduled annotation to help calculate the number of threads the scheduler should create.
>> 
>> Please take a look at the branch and let me know what you think.
>> 
>> Ralph
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 

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


Re: LOG4J2-89

Posted by Gary Gregory <ga...@gmail.com>.
No objection from me.

Gary

On Thu, Nov 19, 2015 at 4:41 PM, Ralph Goers <ra...@dslextreme.com>
wrote:

> Any objections with me merging this to master?
>
> Ralph
>
> > On Nov 16, 2015, at 8:25 PM, Ralph Goers <ra...@dslextreme.com>
> wrote:
> >
> > I have checked in a CronTriggeringPolicy for the RollingFileAppenders on
> branch LOG4J2-89.  It also introduces the ConfigurationScheduler, a more
> generic version of the ScheduledExecutorService I previously added. I am
> envisioning that the scheduler can be used for more time-based tasks.
> Plugins that use the Scheduler should be annotated with the Scheduled
> annotation to help calculate the number of threads the scheduler should
> create.
> >
> > Please take a look at the branch and let me know what you think.
> >
> > Ralph
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-dev-help@logging.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: LOG4J2-89

Posted by Ralph Goers <ra...@dslextreme.com>.
Any objections with me merging this to master?

Ralph

> On Nov 16, 2015, at 8:25 PM, Ralph Goers <ra...@dslextreme.com> wrote:
> 
> I have checked in a CronTriggeringPolicy for the RollingFileAppenders on branch LOG4J2-89.  It also introduces the ConfigurationScheduler, a more generic version of the ScheduledExecutorService I previously added. I am envisioning that the scheduler can be used for more time-based tasks. Plugins that use the Scheduler should be annotated with the Scheduled annotation to help calculate the number of threads the scheduler should create.
> 
> Please take a look at the branch and let me know what you think.
> 
> Ralph
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 
> 



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


Re: LOG4J2-89

Posted by Matt Sicker <bo...@gmail.com>.
I pushed a TypeConverter to your branch.

On 16 November 2015 at 22:03, Matt Sicker <bo...@gmail.com> wrote:

> Could add a TypeConverter for CronExpression.
>
> On 16 November 2015 at 21:49, Matt Sicker <bo...@gmail.com> wrote:
>
>> This sounds like a great feature. I'll take a look at it tomorrow.
>>
>> On 16 November 2015 at 21:25, Ralph Goers <ra...@dslextreme.com>
>> wrote:
>>
>>> I have checked in a CronTriggeringPolicy for the RollingFileAppenders on
>>> branch LOG4J2-89.  It also introduces the ConfigurationScheduler, a more
>>> generic version of the ScheduledExecutorService I previously added. I am
>>> envisioning that the scheduler can be used for more time-based tasks.
>>> Plugins that use the Scheduler should be annotated with the Scheduled
>>> annotation to help calculate the number of threads the scheduler should
>>> create.
>>>
>>> Please take a look at the branch and let me know what you think.
>>>
>>> Ralph
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>>>
>>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>



-- 
Matt Sicker <bo...@gmail.com>

Re: LOG4J2-89

Posted by Matt Sicker <bo...@gmail.com>.
Could add a TypeConverter for CronExpression.

On 16 November 2015 at 21:49, Matt Sicker <bo...@gmail.com> wrote:

> This sounds like a great feature. I'll take a look at it tomorrow.
>
> On 16 November 2015 at 21:25, Ralph Goers <ra...@dslextreme.com>
> wrote:
>
>> I have checked in a CronTriggeringPolicy for the RollingFileAppenders on
>> branch LOG4J2-89.  It also introduces the ConfigurationScheduler, a more
>> generic version of the ScheduledExecutorService I previously added. I am
>> envisioning that the scheduler can be used for more time-based tasks.
>> Plugins that use the Scheduler should be annotated with the Scheduled
>> annotation to help calculate the number of threads the scheduler should
>> create.
>>
>> Please take a look at the branch and let me know what you think.
>>
>> Ralph
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>>
>>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>



-- 
Matt Sicker <bo...@gmail.com>

Re: LOG4J2-89

Posted by "Swor, Steve" <St...@team.telstra.com>.
Scratch that... Ralph already made the changes I was gonna make :-)

On 17/11/15 15:01, Swor, Steve wrote:
I have a working version of the code for this, and I've been meaning to push it back upstream. I'll open a PR shortly.

On 17/11/15 14:57, Matt Sicker wrote:
This sounds like a great feature. I'll take a look at it tomorrow.

On 16 November 2015 at 21:25, Ralph Goers <ra...@dslextreme.com>> wrote:
I have checked in a CronTriggeringPolicy for the RollingFileAppenders on branch LOG4J2-89.  It also introduces the ConfigurationScheduler, a more generic version of the ScheduledExecutorService I previously added. I am envisioning that the scheduler can be used for more time-based tasks. Plugins that use the Scheduler should be annotated with the Scheduled annotation to help calculate the number of threads the scheduler should create.

Please take a look at the branch and let me know what you think.

Ralph

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org<ma...@logging.apache.org>
For additional commands, e-mail: <ma...@logging.apache.org> log4j-dev-help@logging.apache.org<ma...@logging.apache.org>




--
Matt Sicker <<m...@gmail.com>>



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


Re: LOG4J2-89

Posted by "Swor, Steve" <St...@team.telstra.com>.
I have a working version of the code for this, and I've been meaning to push it back upstream. I'll open a PR shortly.

On 17/11/15 14:57, Matt Sicker wrote:
This sounds like a great feature. I'll take a look at it tomorrow.

On 16 November 2015 at 21:25, Ralph Goers <ra...@dslextreme.com>> wrote:
I have checked in a CronTriggeringPolicy for the RollingFileAppenders on branch LOG4J2-89.  It also introduces the ConfigurationScheduler, a more generic version of the ScheduledExecutorService I previously added. I am envisioning that the scheduler can be used for more time-based tasks. Plugins that use the Scheduler should be annotated with the Scheduled annotation to help calculate the number of threads the scheduler should create.

Please take a look at the branch and let me know what you think.

Ralph

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org<ma...@logging.apache.org>
For additional commands, e-mail: log4j-dev-help@logging.apache.org<ma...@logging.apache.org>




--
Matt Sicker <<m...@gmail.com>>


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


Re: LOG4J2-89

Posted by Matt Sicker <bo...@gmail.com>.
This sounds like a great feature. I'll take a look at it tomorrow.

On 16 November 2015 at 21:25, Ralph Goers <ra...@dslextreme.com>
wrote:

> I have checked in a CronTriggeringPolicy for the RollingFileAppenders on
> branch LOG4J2-89.  It also introduces the ConfigurationScheduler, a more
> generic version of the ScheduledExecutorService I previously added. I am
> envisioning that the scheduler can be used for more time-based tasks.
> Plugins that use the Scheduler should be annotated with the Scheduled
> annotation to help calculate the number of threads the scheduler should
> create.
>
> Please take a look at the branch and let me know what you think.
>
> Ralph
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
>


-- 
Matt Sicker <bo...@gmail.com>

Re: LOG4J2-89

Posted by Ralph Goers <ra...@dslextreme.com>.
Also, it would make sense to me to have the delete mechanism you are implementing to also be able to use the scheduler. But if you do that I would expect we would have a new ScheduledItems section in the configuration. At that point users could create their own plugins and schedule them.

Ralph

> On Nov 16, 2015, at 10:46 PM, Ralph Goers <ra...@dslextreme.com> wrote:
> 
> Yes, @Scheduled is a way to let the scheduler know how many items will be scheduled. Realistically they don’t each need their own thread since they will likely happen at different times. I don’t want a single thread because multiple items are likely to be scheduled at the same time - like midnight. If you use a Timer task then the Timer task that runs really needs to spawn a new thread to do the actual work. Otherwise it runs the risk of tying up the scheduler for a long period of time. I figure that with a max of 5 threads that shouldn’t be a problem.
> 
> Also, the WatchManager isn’t a plugin and registers itself with the scheduler. It can be watching multiple files and each interval it will check all the files. I am assuming that eventually the FileConfigurationMonitor will be modified to use the WatchManager, and if we implement support for multiple configuration files and with multiple script files the number of things being monitored could cause the WatchManager to take a few seconds on each interval. So if the WatchManager is active and there are any other scheduled items I would want at least 2 threads. Note that we can tune the algorithm for how many threads we actually create.
> 
> Ralph
> 
>> On Nov 16, 2015, at 10:30 PM, Remko Popma <re...@gmail.com> wrote:
>> 
>> I only read the commit emails on my phone, so my understanding is still a bit superficial, but I noticed each @Scheduled element gets its own thread (up to max 5 threads, after that they start sharing). Why not use just one thread that executives all scheduled/submitted tasks?
>> 
>> Remko 
>> 
>> Sent from my iPhone
>> 
>>> On 2015/11/17, at 12:25, Ralph Goers <ra...@dslextreme.com> wrote:
>>> 
>>> I have checked in a CronTriggeringPolicy for the RollingFileAppenders on branch LOG4J2-89.  It also introduces the ConfigurationScheduler, a more generic version of the ScheduledExecutorService I previously added. I am envisioning that the scheduler can be used for more time-based tasks. Plugins that use the Scheduler should be annotated with the Scheduled annotation to help calculate the number of threads the scheduler should create.
>>> 
>>> Please take a look at the branch and let me know what you think.
>>> 
>>> Ralph
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>> 
>> 
> 



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


Re: LOG4J2-89

Posted by Ralph Goers <ra...@dslextreme.com>.
Yes, @Scheduled is a way to let the scheduler know how many items will be scheduled. Realistically they don’t each need their own thread since they will likely happen at different times. I don’t want a single thread because multiple items are likely to be scheduled at the same time - like midnight. If you use a Timer task then the Timer task that runs really needs to spawn a new thread to do the actual work. Otherwise it runs the risk of tying up the scheduler for a long period of time. I figure that with a max of 5 threads that shouldn’t be a problem.

Also, the WatchManager isn’t a plugin and registers itself with the scheduler. It can be watching multiple files and each interval it will check all the files. I am assuming that eventually the FileConfigurationMonitor will be modified to use the WatchManager, and if we implement support for multiple configuration files and with multiple script files the number of things being monitored could cause the WatchManager to take a few seconds on each interval. So if the WatchManager is active and there are any other scheduled items I would want at least 2 threads. Note that we can tune the algorithm for how many threads we actually create.

Ralph

> On Nov 16, 2015, at 10:30 PM, Remko Popma <re...@gmail.com> wrote:
> 
> I only read the commit emails on my phone, so my understanding is still a bit superficial, but I noticed each @Scheduled element gets its own thread (up to max 5 threads, after that they start sharing). Why not use just one thread that executives all scheduled/submitted tasks?
> 
> Remko 
> 
> Sent from my iPhone
> 
>> On 2015/11/17, at 12:25, Ralph Goers <ra...@dslextreme.com> wrote:
>> 
>> I have checked in a CronTriggeringPolicy for the RollingFileAppenders on branch LOG4J2-89.  It also introduces the ConfigurationScheduler, a more generic version of the ScheduledExecutorService I previously added. I am envisioning that the scheduler can be used for more time-based tasks. Plugins that use the Scheduler should be annotated with the Scheduled annotation to help calculate the number of threads the scheduler should create.
>> 
>> Please take a look at the branch and let me know what you think.
>> 
>> Ralph
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 
> 



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


Re: LOG4J2-89

Posted by Remko Popma <re...@gmail.com>.
I only read the commit emails on my phone, so my understanding is still a bit superficial, but I noticed each @Scheduled element gets its own thread (up to max 5 threads, after that they start sharing). Why not use just one thread that executives all scheduled/submitted tasks?

Remko 

Sent from my iPhone

> On 2015/11/17, at 12:25, Ralph Goers <ra...@dslextreme.com> wrote:
> 
> I have checked in a CronTriggeringPolicy for the RollingFileAppenders on branch LOG4J2-89.  It also introduces the ConfigurationScheduler, a more generic version of the ScheduledExecutorService I previously added. I am envisioning that the scheduler can be used for more time-based tasks. Plugins that use the Scheduler should be annotated with the Scheduled annotation to help calculate the number of threads the scheduler should create.
> 
> Please take a look at the branch and let me know what you think.
> 
> Ralph
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 

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