You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Stadelmann Josef <jo...@axa-winterthur.ch> on 2010/12/06 12:06:18 UTC

AW: does log4j support wildcard

But is that given solution a real wildcard? "${user.dir}/../logs/eco" I guess no.

1.${user.dir} muts be define dpreviously or it comes implementation dependent as "" 
2. and this may lead to errors
3. then /../ directs to go up in the tree one level 
4. before you go down in the tree to /logs/eco

Given ${user.dir} is not defined when used, what is the outcome?

${user.dir} must be a property may be a macro which is defined prior to beeing used.

But if you say C:\ > dir stade*.doc then the "*" is a true wildcard saying 
that anything wild after "stade" can stay unless the dot is received from 
where on only files with a doc extension will be listed in the directory 
command.

So 
stade1.doc
stade2.doc
stadeX.doc
but not
stadeN.dot

are listed

Also id ${user.dior} would be something like 112345 (as possible for wildcards)
Would that make sense in the wanted use and context? No, so I would not refer to
${user.dir} as to a widlcard, even ${user.dir} migth be defined to a valid user
On most OS and platforms, but have to lead/form part of a TRUE PATH in the end.

While this is not necessary for a true wildcard character. 

Or do we have to re-define what wildcards are?

Josef




-----Ursprüngliche Nachricht-----
Von: maven apache [mailto:apachemaven0@gmail.com] 
Gesendet: Dienstag, 30. November 2010 11:10
An: Log4J Users List
Betreff: Re: does log4j support wildcard

2010/11/30 JOSE L MARTINEZ-AVIAL <jl...@gmail.com>

> For example, to use the user dir in the path:
> log4j.appender.ECO_LOG.File=${user.dir}/../logs/eco.log
>

:) Thank you very much.

>
>
>
> 2010/11/30 maven apache <ap...@gmail.com>
>
> > 2010/11/30 JOSE L MARTINEZ-AVIAL <jl...@gmail.com>
> >
> > > A system propertie will do. I use it, and works perfectly.
> > >
> > Thanks, I will have a try. :)
> >
> > >
> > > 2010/11/30 maven apache <ap...@gmail.com>
> > >
> > > > 2010/11/30 Stadelmann Josef <jo...@axa-winterthur.ch>
> > > >
> > > > > How can you define a destination with a widlcard?
> > > > > Think : copy file-a.txt to {widlcard}
> > > > > where wildcard is not defined when copy starts executing,
> > > > > and then tell me where file-a.txt is after the copy completes?
> > > > >
> > > > > My question is where to define the xxxx.
> > > >
> > > >
> > > > > Maybe you think of xxxx as shown below!
> > > > > # R is a rolling file appender  --- not used yet / no need to parse
> > > > > log4j.appender.R=org.apache.log4j.RollingFileAppender
> > > > > log4j.appender.R.Append=true
> > > > > log4j.appender.R.File=${xxxx}logs/tomcat.log
> > > > > log4j.appender.R.MaxFileSize=2MB
> > > > > log4j.appender.R.MaxBackupIndex=10
> > > > > log4j.appender.R.layout=org.apache.log4j.PatternLayout
> > > > > log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
> > > > >
> > > > > now xxxx is your exported environment variable or a logical
> > > > > and it needs to be defined unless your log will be written at
> > > > >
> > > > > Yes,so it means the xxxx can be set in the System.properties?
> > > >
> > > >
> > > > > ./logs/tomcat.log
> > > > >
> > > > > Josef
> > > > >
> > > > >
> > > > >
> > > > > -----Ursprüngliche Nachricht-----
> > > > > Von: maven apache [mailto:apachemaven0@gmail.com]
> > > > > Gesendet: Dienstag, 30. November 2010 00:31
> > > > > An: Log4J Users List
> > > > > Betreff: Re: does log4j support wildcard
> > > > >
> > > > >   1. log4j.appender.FILE=org.apache.log4j.FileAppender
> > > > >   2. log4j.appender.FILE.File={xxxx}/file.log
> > > > >
> > > > > where the xxxx is the wildcard
> > > > >
> > > > > 2010/11/30 Scott Deboy <sc...@gmail.com>
> > > > >
> > > > > > Can you clarify what you mean specifically by 'wildcard'?
> > > > > >
> > > > > > Scott
> > > > > >
> > > > > > On Mon, Nov 29, 2010 at 3:32 AM, maven apache <
> > > apachemaven0@gmail.com
> > > > > > >wrote:
> > > > > >
> > > > > > > Hi:
> > > > > > > Does log4j support wildcard?
> > > > > > >
> > > > > > > Is there a example?
> > > > > > >
> > > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > > > For additional commands, e-mail:
> log4j-user-help@logging.apache.org
> > > > >
> > > > >
> > > >
> > >
> >
>

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


AW: does log4j support wildcard

Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Now I agree with you 100%; Guess it makes sense sometimes to read from 
various paths using wildcard's in the paths. But writing to paths (plural) 
does not make a lot sense. :-)

Placeholder makes however big sense.
Josef


-----Ursprüngliche Nachricht-----
Von: maven apache [mailto:apachemaven0@gmail.com] 
Gesendet: Montag, 6. Dezember 2010 12:43
An: Log4J Users List
Betreff: Re: does log4j support wildcard

My fault, I think it is my express problem,maybe I mean the placeholder
rather than the wildcard.

2010/12/6 JOSE L MARTINEZ-AVIAL <jl...@gmail.com>

> user.dir is a system properties, as defined in
> http://download.oracle.com/javase/1.4.2/docs/api/java/lang/System.html
>
> You can setup dinamically other variable and use it. But you are right in
> the sense that it is not a wildcard. What I'm wondering is in what context
> makes sense to use a wildcard when defining the path where a file will be
> written. What happens if there is more than one path that can fit the
> wildcard? which one is used?
>
> 2010/12/6 Stadelmann Josef <jo...@axa-winterthur.ch>
>
> > But is that given solution a real wildcard? "${user.dir}/../logs/eco" I
> > guess no.
> >
> > 1.${user.dir} muts be define dpreviously or it comes implementation
> > dependent as ""
> > 2. and this may lead to errors
> > 3. then /../ directs to go up in the tree one level
> > 4. before you go down in the tree to /logs/eco
> >
> > Given ${user.dir} is not defined when used, what is the outcome?
> >
> > ${user.dir} must be a property may be a macro which is defined prior to
> > beeing used.
> >
> > But if you say C:\ > dir stade*.doc then the "*" is a true wildcard
> saying
> > that anything wild after "stade" can stay unless the dot is received from
> > where on only files with a doc extension will be listed in the directory
> > command.
> >
> > So
> > stade1.doc
> > stade2.doc
> > stadeX.doc
> > but not
> > stadeN.dot
> >
> > are listed
> >
> > Also id ${user.dior} would be something like 112345 (as possible for
> > wildcards)
> > Would that make sense in the wanted use and context? No, so I would not
> > refer to
> > ${user.dir} as to a widlcard, even ${user.dir} migth be defined to a
> valid
> > user
> > On most OS and platforms, but have to lead/form part of a TRUE PATH in
> the
> > end.
> >
> > While this is not necessary for a true wildcard character.
> >
> > Or do we have to re-define what wildcards are?
> >
> > Josef
> >
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: maven apache [mailto:apachemaven0@gmail.com]
> > Gesendet: Dienstag, 30. November 2010 11:10
> > An: Log4J Users List
> > Betreff: Re: does log4j support wildcard
> >
> > 2010/11/30 JOSE L MARTINEZ-AVIAL <jl...@gmail.com>
> >
> > > For example, to use the user dir in the path:
> > > log4j.appender.ECO_LOG.File=${user.dir}/../logs/eco.log
> > >
> >
> > :) Thank you very much.
> >
> > >
> > >
> > >
> > > 2010/11/30 maven apache <ap...@gmail.com>
> > >
> > > > 2010/11/30 JOSE L MARTINEZ-AVIAL <jl...@gmail.com>
> > > >
> > > > > A system propertie will do. I use it, and works perfectly.
> > > > >
> > > > Thanks, I will have a try. :)
> > > >
> > > > >
> > > > > 2010/11/30 maven apache <ap...@gmail.com>
> > > > >
> > > > > > 2010/11/30 Stadelmann Josef <jo...@axa-winterthur.ch>
> > > > > >
> > > > > > > How can you define a destination with a widlcard?
> > > > > > > Think : copy file-a.txt to {widlcard}
> > > > > > > where wildcard is not defined when copy starts executing,
> > > > > > > and then tell me where file-a.txt is after the copy completes?
> > > > > > >
> > > > > > > My question is where to define the xxxx.
> > > > > >
> > > > > >
> > > > > > > Maybe you think of xxxx as shown below!
> > > > > > > # R is a rolling file appender  --- not used yet / no need to
> > parse
> > > > > > > log4j.appender.R=org.apache.log4j.RollingFileAppender
> > > > > > > log4j.appender.R.Append=true
> > > > > > > log4j.appender.R.File=${xxxx}logs/tomcat.log
> > > > > > > log4j.appender.R.MaxFileSize=2MB
> > > > > > > log4j.appender.R.MaxBackupIndex=10
> > > > > > > log4j.appender.R.layout=org.apache.log4j.PatternLayout
> > > > > > > log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
> > > > > > >
> > > > > > > now xxxx is your exported environment variable or a logical
> > > > > > > and it needs to be defined unless your log will be written at
> > > > > > >
> > > > > > > Yes,so it means the xxxx can be set in the System.properties?
> > > > > >
> > > > > >
> > > > > > > ./logs/tomcat.log
> > > > > > >
> > > > > > > Josef
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > -----Ursprüngliche Nachricht-----
> > > > > > > Von: maven apache [mailto:apachemaven0@gmail.com]
> > > > > > > Gesendet: Dienstag, 30. November 2010 00:31
> > > > > > > An: Log4J Users List
> > > > > > > Betreff: Re: does log4j support wildcard
> > > > > > >
> > > > > > >   1. log4j.appender.FILE=org.apache.log4j.FileAppender
> > > > > > >   2. log4j.appender.FILE.File={xxxx}/file.log
> > > > > > >
> > > > > > > where the xxxx is the wildcard
> > > > > > >
> > > > > > > 2010/11/30 Scott Deboy <sc...@gmail.com>
> > > > > > >
> > > > > > > > Can you clarify what you mean specifically by 'wildcard'?
> > > > > > > >
> > > > > > > > Scott
> > > > > > > >
> > > > > > > > On Mon, Nov 29, 2010 at 3:32 AM, maven apache <
> > > > > apachemaven0@gmail.com
> > > > > > > > >wrote:
> > > > > > > >
> > > > > > > > > Hi:
> > > > > > > > > Does log4j support wildcard?
> > > > > > > > >
> > > > > > > > > Is there a example?
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail:
> > log4j-user-unsubscribe@logging.apache.org
> > > > > > > For additional commands, e-mail:
> > > log4j-user-help@logging.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>

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


Re: does log4j support wildcard

Posted by maven apache <ap...@gmail.com>.
My fault, I think it is my express problem,maybe I mean the placeholder
rather than the wildcard.

2010/12/6 JOSE L MARTINEZ-AVIAL <jl...@gmail.com>

> user.dir is a system properties, as defined in
> http://download.oracle.com/javase/1.4.2/docs/api/java/lang/System.html
>
> You can setup dinamically other variable and use it. But you are right in
> the sense that it is not a wildcard. What I'm wondering is in what context
> makes sense to use a wildcard when defining the path where a file will be
> written. What happens if there is more than one path that can fit the
> wildcard? which one is used?
>
> 2010/12/6 Stadelmann Josef <jo...@axa-winterthur.ch>
>
> > But is that given solution a real wildcard? "${user.dir}/../logs/eco" I
> > guess no.
> >
> > 1.${user.dir} muts be define dpreviously or it comes implementation
> > dependent as ""
> > 2. and this may lead to errors
> > 3. then /../ directs to go up in the tree one level
> > 4. before you go down in the tree to /logs/eco
> >
> > Given ${user.dir} is not defined when used, what is the outcome?
> >
> > ${user.dir} must be a property may be a macro which is defined prior to
> > beeing used.
> >
> > But if you say C:\ > dir stade*.doc then the "*" is a true wildcard
> saying
> > that anything wild after "stade" can stay unless the dot is received from
> > where on only files with a doc extension will be listed in the directory
> > command.
> >
> > So
> > stade1.doc
> > stade2.doc
> > stadeX.doc
> > but not
> > stadeN.dot
> >
> > are listed
> >
> > Also id ${user.dior} would be something like 112345 (as possible for
> > wildcards)
> > Would that make sense in the wanted use and context? No, so I would not
> > refer to
> > ${user.dir} as to a widlcard, even ${user.dir} migth be defined to a
> valid
> > user
> > On most OS and platforms, but have to lead/form part of a TRUE PATH in
> the
> > end.
> >
> > While this is not necessary for a true wildcard character.
> >
> > Or do we have to re-define what wildcards are?
> >
> > Josef
> >
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: maven apache [mailto:apachemaven0@gmail.com]
> > Gesendet: Dienstag, 30. November 2010 11:10
> > An: Log4J Users List
> > Betreff: Re: does log4j support wildcard
> >
> > 2010/11/30 JOSE L MARTINEZ-AVIAL <jl...@gmail.com>
> >
> > > For example, to use the user dir in the path:
> > > log4j.appender.ECO_LOG.File=${user.dir}/../logs/eco.log
> > >
> >
> > :) Thank you very much.
> >
> > >
> > >
> > >
> > > 2010/11/30 maven apache <ap...@gmail.com>
> > >
> > > > 2010/11/30 JOSE L MARTINEZ-AVIAL <jl...@gmail.com>
> > > >
> > > > > A system propertie will do. I use it, and works perfectly.
> > > > >
> > > > Thanks, I will have a try. :)
> > > >
> > > > >
> > > > > 2010/11/30 maven apache <ap...@gmail.com>
> > > > >
> > > > > > 2010/11/30 Stadelmann Josef <jo...@axa-winterthur.ch>
> > > > > >
> > > > > > > How can you define a destination with a widlcard?
> > > > > > > Think : copy file-a.txt to {widlcard}
> > > > > > > where wildcard is not defined when copy starts executing,
> > > > > > > and then tell me where file-a.txt is after the copy completes?
> > > > > > >
> > > > > > > My question is where to define the xxxx.
> > > > > >
> > > > > >
> > > > > > > Maybe you think of xxxx as shown below!
> > > > > > > # R is a rolling file appender  --- not used yet / no need to
> > parse
> > > > > > > log4j.appender.R=org.apache.log4j.RollingFileAppender
> > > > > > > log4j.appender.R.Append=true
> > > > > > > log4j.appender.R.File=${xxxx}logs/tomcat.log
> > > > > > > log4j.appender.R.MaxFileSize=2MB
> > > > > > > log4j.appender.R.MaxBackupIndex=10
> > > > > > > log4j.appender.R.layout=org.apache.log4j.PatternLayout
> > > > > > > log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
> > > > > > >
> > > > > > > now xxxx is your exported environment variable or a logical
> > > > > > > and it needs to be defined unless your log will be written at
> > > > > > >
> > > > > > > Yes,so it means the xxxx can be set in the System.properties?
> > > > > >
> > > > > >
> > > > > > > ./logs/tomcat.log
> > > > > > >
> > > > > > > Josef
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > -----Ursprüngliche Nachricht-----
> > > > > > > Von: maven apache [mailto:apachemaven0@gmail.com]
> > > > > > > Gesendet: Dienstag, 30. November 2010 00:31
> > > > > > > An: Log4J Users List
> > > > > > > Betreff: Re: does log4j support wildcard
> > > > > > >
> > > > > > >   1. log4j.appender.FILE=org.apache.log4j.FileAppender
> > > > > > >   2. log4j.appender.FILE.File={xxxx}/file.log
> > > > > > >
> > > > > > > where the xxxx is the wildcard
> > > > > > >
> > > > > > > 2010/11/30 Scott Deboy <sc...@gmail.com>
> > > > > > >
> > > > > > > > Can you clarify what you mean specifically by 'wildcard'?
> > > > > > > >
> > > > > > > > Scott
> > > > > > > >
> > > > > > > > On Mon, Nov 29, 2010 at 3:32 AM, maven apache <
> > > > > apachemaven0@gmail.com
> > > > > > > > >wrote:
> > > > > > > >
> > > > > > > > > Hi:
> > > > > > > > > Does log4j support wildcard?
> > > > > > > > >
> > > > > > > > > Is there a example?
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail:
> > log4j-user-unsubscribe@logging.apache.org
> > > > > > > For additional commands, e-mail:
> > > log4j-user-help@logging.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>

Re: does log4j support wildcard

Posted by JOSE L MARTINEZ-AVIAL <jl...@gmail.com>.
user.dir is a system properties, as defined in
http://download.oracle.com/javase/1.4.2/docs/api/java/lang/System.html

You can setup dinamically other variable and use it. But you are right in
the sense that it is not a wildcard. What I'm wondering is in what context
makes sense to use a wildcard when defining the path where a file will be
written. What happens if there is more than one path that can fit the
wildcard? which one is used?

2010/12/6 Stadelmann Josef <jo...@axa-winterthur.ch>

> But is that given solution a real wildcard? "${user.dir}/../logs/eco" I
> guess no.
>
> 1.${user.dir} muts be define dpreviously or it comes implementation
> dependent as ""
> 2. and this may lead to errors
> 3. then /../ directs to go up in the tree one level
> 4. before you go down in the tree to /logs/eco
>
> Given ${user.dir} is not defined when used, what is the outcome?
>
> ${user.dir} must be a property may be a macro which is defined prior to
> beeing used.
>
> But if you say C:\ > dir stade*.doc then the "*" is a true wildcard saying
> that anything wild after "stade" can stay unless the dot is received from
> where on only files with a doc extension will be listed in the directory
> command.
>
> So
> stade1.doc
> stade2.doc
> stadeX.doc
> but not
> stadeN.dot
>
> are listed
>
> Also id ${user.dior} would be something like 112345 (as possible for
> wildcards)
> Would that make sense in the wanted use and context? No, so I would not
> refer to
> ${user.dir} as to a widlcard, even ${user.dir} migth be defined to a valid
> user
> On most OS and platforms, but have to lead/form part of a TRUE PATH in the
> end.
>
> While this is not necessary for a true wildcard character.
>
> Or do we have to re-define what wildcards are?
>
> Josef
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: maven apache [mailto:apachemaven0@gmail.com]
> Gesendet: Dienstag, 30. November 2010 11:10
> An: Log4J Users List
> Betreff: Re: does log4j support wildcard
>
> 2010/11/30 JOSE L MARTINEZ-AVIAL <jl...@gmail.com>
>
> > For example, to use the user dir in the path:
> > log4j.appender.ECO_LOG.File=${user.dir}/../logs/eco.log
> >
>
> :) Thank you very much.
>
> >
> >
> >
> > 2010/11/30 maven apache <ap...@gmail.com>
> >
> > > 2010/11/30 JOSE L MARTINEZ-AVIAL <jl...@gmail.com>
> > >
> > > > A system propertie will do. I use it, and works perfectly.
> > > >
> > > Thanks, I will have a try. :)
> > >
> > > >
> > > > 2010/11/30 maven apache <ap...@gmail.com>
> > > >
> > > > > 2010/11/30 Stadelmann Josef <jo...@axa-winterthur.ch>
> > > > >
> > > > > > How can you define a destination with a widlcard?
> > > > > > Think : copy file-a.txt to {widlcard}
> > > > > > where wildcard is not defined when copy starts executing,
> > > > > > and then tell me where file-a.txt is after the copy completes?
> > > > > >
> > > > > > My question is where to define the xxxx.
> > > > >
> > > > >
> > > > > > Maybe you think of xxxx as shown below!
> > > > > > # R is a rolling file appender  --- not used yet / no need to
> parse
> > > > > > log4j.appender.R=org.apache.log4j.RollingFileAppender
> > > > > > log4j.appender.R.Append=true
> > > > > > log4j.appender.R.File=${xxxx}logs/tomcat.log
> > > > > > log4j.appender.R.MaxFileSize=2MB
> > > > > > log4j.appender.R.MaxBackupIndex=10
> > > > > > log4j.appender.R.layout=org.apache.log4j.PatternLayout
> > > > > > log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
> > > > > >
> > > > > > now xxxx is your exported environment variable or a logical
> > > > > > and it needs to be defined unless your log will be written at
> > > > > >
> > > > > > Yes,so it means the xxxx can be set in the System.properties?
> > > > >
> > > > >
> > > > > > ./logs/tomcat.log
> > > > > >
> > > > > > Josef
> > > > > >
> > > > > >
> > > > > >
> > > > > > -----Ursprüngliche Nachricht-----
> > > > > > Von: maven apache [mailto:apachemaven0@gmail.com]
> > > > > > Gesendet: Dienstag, 30. November 2010 00:31
> > > > > > An: Log4J Users List
> > > > > > Betreff: Re: does log4j support wildcard
> > > > > >
> > > > > >   1. log4j.appender.FILE=org.apache.log4j.FileAppender
> > > > > >   2. log4j.appender.FILE.File={xxxx}/file.log
> > > > > >
> > > > > > where the xxxx is the wildcard
> > > > > >
> > > > > > 2010/11/30 Scott Deboy <sc...@gmail.com>
> > > > > >
> > > > > > > Can you clarify what you mean specifically by 'wildcard'?
> > > > > > >
> > > > > > > Scott
> > > > > > >
> > > > > > > On Mon, Nov 29, 2010 at 3:32 AM, maven apache <
> > > > apachemaven0@gmail.com
> > > > > > > >wrote:
> > > > > > >
> > > > > > > > Hi:
> > > > > > > > Does log4j support wildcard?
> > > > > > > >
> > > > > > > > Is there a example?
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail:
> log4j-user-unsubscribe@logging.apache.org
> > > > > > For additional commands, e-mail:
> > log4j-user-help@logging.apache.org
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>