Re: Set the file name based on command line args

2014-08-08 Thread Matt Sicker
rgs); Is the args array a > >>>>> reference > >>>>>>>> or a > >>>>>>>>>> deep copy? > >>>>>>>>>> - Another is the more complex and vendor dependent (and > unproven) > >>>>>> sta

Re: Set the file name based on command line args

2014-08-08 Thread Remko Popma
d vendor dependent (and unproven) >>>>>> stack >>>>>>>>>> walker. >>>>>>>>>> >>>>>>>>>> Gary >>>>>>>>>> >>>>>>>>>> >>>>

Re: Set the file name based on command line args

2014-08-08 Thread Gary Gregory
gt;>>>>>>>> > >>>>>>>>> > >>>>>>>>>> On 6 August 2014 20:19, Gary Gregory > >>>> wrote: > >>>>>>>>>> > >>>>>>>>>> And worse: vendor spe

Re: Set the file name based on command line args

2014-08-08 Thread Remko Popma
>>>>>>>>>> >>>>>>>>>> Gary >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> On Wed, Aug 6, 2014 at 9:05 PM, Remko Popma < >>> remko.po...@gmail.com >>

Re: Set the file name based on command line args

2014-08-08 Thread Matt Sicker
> >>>>>>> Thanks for the pointer! > > > >>>>>>> > > > >>>>>>> Sent from my iPhone > > > >>>>>>> > > > >>>>>>>> On 2014/08/07, at 9:44, Gary Gregory > > >

Re: Set the file name based on command line args

2014-08-08 Thread Remko Popma
> > > >>>>>>> Sent from my iPhone > > >>>>>>> > > >>>>>>>> On 2014/08/07, at 9:44, Gary Gregory > > >>>>> wrote: > > >>>>>>>> > > >>>>>>>

Re: Set the file name based on command line args

2014-08-08 Thread Gary Gregory
>> > http://docs.oracle.com/javase/7/docs/jdk/api/jpda/jdi/com/sun/jdi/StackFrame.html > >>>>>>>> > >>>>>>>> Gary > >>>>>>>> > >>>>>>>> > >>>>>>>>> On We

Re: Set the file name based on command line args

2014-08-08 Thread Remko Popma
gt; >>>>>>>> Gary >>>>>>>> >>>>>>>> >>>>>>>>> On Wed, Aug 6, 2014 at 8:36 PM, Remko Popma < >>>>> remko.po...@gmail.com> >>>>>>> wrote: >>>>>&

Re: Set the file name based on command line args

2014-08-08 Thread Mikael Ståldal
> > > >> > >>> > > >> I don't follow... If you walk the stack trace you can find the > >>> name of > >>> > > the > >>> > > >> original class whose main() method was called, but how would > that > >>&

Re: Set the file name based on command line args

2014-08-07 Thread Gary Gregory
gt; > > the >>> > > >> original class whose main() method was called, but how would that >>> give >>> > > you >>> > > >> access to the main method's parameter values? >>> > > >> >>> > > >

Re: Set the file name based on command line args

2014-08-07 Thread Gary Gregory
; give >> > > you >> > > >> access to the main method's parameter values? >> > > >> >> > > >> Sent from my iPhone >> > > >> >> > > >>> On 2014/08/07, at 9:26, Gary Gregory >> wrote: >> > > >>&g

Re: Set the file name based on command line args

2014-08-06 Thread Gary Gregory
9:26, Gary Gregory > wrote: > > > >>> > > > >>> Yes you are right but the stack walker could be used even if you do > > not > > > >> control to source for main. Maybe a script calls a main and then my > > app > > > >>

Re: Set the file name based on command line args

2014-08-06 Thread Matt Sicker
egory wrote: > > >>> > > >>> Yes you are right but the stack walker could be used even if you do > not > > >> control to source for main. Maybe a script calls a main and then my > app > > >> plugin gets called and I want to also follow the verbos

Re: Set the file name based on command line args

2014-08-06 Thread Gary Gregory
e > >> setting. > >>> > >>> > >>> Gary > >>> > >>> Original message From: Ralph Goers < > >> ralph.go...@dslextreme.com> Date:08/06/2014 19:18 > >> (GMT-05:00) To: Log4J Users List < &g

Re: Set the file name based on command line args

2014-08-06 Thread Remko Popma
then my app >> plugin gets called and I want to also follow the verbose command line >> setting. >>> >>> >>> Gary >>> >>> Original message ----From: Ralph Goers < >> ralph.go...@dslextreme.com> Date:08/06/2014 19:18 >> (GMT-05:0

Re: Set the file name based on command line args

2014-08-06 Thread Gary Gregory
/06/2014 19:18 > (GMT-05:00) To: Log4J Users List < > log4j-user@logging.apache.org> Subject: Re: Set the file name > based on command line args > > Wouldn’t it be easier to have a Lookup that your main called and > just passed the arguments? But yeah, it should

Re: Set the file name based on command line args

2014-08-06 Thread Remko Popma
: Ralph Goers > Date:08/06/2014 19:18 (GMT-05:00) > To: Log4J Users List > Subject: Re: Set the file name based on command line args > > Wouldn’t it be easier to have a Lookup that your main called and just > passed the arguments? But yeah, it should be possible to do w

Re: Set the file name based on command line args

2014-08-06 Thread Gary Gregory
/2014 19:18 (GMT-05:00) To: Log4J Users List Subject: Re: Set the file name based on command line args Wouldn’t it be easier to have a Lookup that your main called and just passed the arguments? But yeah, it should be possible to do what you are suggesting. Ralph On Aug 6, 2014, at 4:09 PM

Re: Set the file name based on command line args

2014-08-06 Thread Ralph Goers
Wouldn’t it be easier to have a Lookup that your main called and just passed the arguments? But yeah, it should be possible to do what you are suggesting. Ralph On Aug 6, 2014, at 4:09 PM, Gary Gregory wrote: > I wonder if we could write a "MainArgumentsLookup" that finds the main > thread an

Re: Set the file name based on command line args

2014-08-06 Thread Gary Gregory
I wonder if we could write a "MainArgumentsLookup" that finds the main thread and walks up the stack to the public static main(String[]) main methods and gets the arguments from the stack... Gary On Wed, Aug 6, 2014 at 6:54 PM, Ralph Goers wrote: > Well…. > > You would really be passing the na

Re: Set the file name based on command line args

2014-08-06 Thread Ralph Goers
Well…. You would really be passing the name of the file to the Appender, not a Logger. Loggers only reference Appenders so you can’t really configure them with Appender configuration data. That said, Log4j 2 provides a few ways you could do this: 1. Set a system property and reference it via

Set the file name based on command line args

2014-08-06 Thread Arwen Pond
My application takes a parameter where the user can specify the log file. I'd like to pass this parameter to the Logger which uses a FileAppender. I am not sure how to do this in log4j 2. Thanks, Arwen This electronic mail message contains information that (a) is or may be CONFIDENTIAL, PROP