logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kikou1984 <oueslati.hic...@gmail.com>
Subject Re: Find word in log
Date Tue, 22 Nov 2011 08:44:48 GMT

Thanks for these information.

I thought that  with the log4j.properties, i could create a filter or tail
the log. 

so if i have to write a new app, i should create a new logger , and when i
see in the  code the word [SUIVI_TRT] , i will add the String to this new
logger. then i will get a logger with only ligne contains [SUIVI_TRT].





ralph.goers @dslextreme.com wrote:
> 
> A logger is used a) by applications to generate log events or b) in a
> configuration file to identify one or more appenders to route events to
> and to filter events.  The way you are using the word doesn't apply to
> either.
> 
> If I understand what you want you need some other application that tails
> the log file being written and inspects the events as they arrive and then
> does something with the events it sees.  You could certainly use Log4j to
> write the new messages, but you will have to write the app to tail the log
> and filter it.
> 
> Normally, one would go to each application and add a new appender to the
> existing logger to send the specific events you are interested in to the
> new destination.
> 
> Ralph
> 
> On Nov 21, 2011, at 9:23 AM, Kikou1984 wrote:
> 
>> 
>> I will explain better .
>> 
>> I got many program , each program got his log. 
>> 
>> Sometimes , this log contains this word "SUIVI_TRT". like this 
>> log.info("[SUIVI_TRT] [TrtEnd=UPDATE_BORDERO] [ReturnCode=KO][ErrorCode="
>> +
>> flow.getErrorCode() + "] ");
>> 
>> I want to create a new logger , this one will take all the program logger
>> which only contains this work in log [SUIVI_TRT] .
>> 
>> That's the problem, how can log4j knows that the log contains 
>> [SUIVI_TRT]
>> and he must put this new ligne in a new logger ( a new file). 
>> 
>> 
>> 
>> 
>> 
>> ralph.goers @dslextreme.com wrote:
>>> 
>>> I don't understand.  You stated you have a log that is currently being
>>> written. I presume this is going to some location and you would like
>>> that
>>> to continue. From your request it sounds like you want just the prefix
>>> portion to go to a separate log in addition to the first one.  To do
>>> that
>>> you just configure the single logger with two appenders - the original
>>> one
>>> and a new one with a layout that only generates the prefix.
>>> 
>>> Ralph
>>> 
>>> On Nov 21, 2011, at 8:46 AM, Kikou1984 wrote:
>>> 
>>>> 
>>>> Yes,  i should make as you said, but i want to use the first logger
>>>> which
>>>> contains the string "[SUIVI_TRT]".
>>>> 
>>>> I want to create like a parse , catch logger where contains [SUIVI_TRT]
>>>> and
>>>> put this ligne on a new logger.
>>>> 
>>>> 
>>>> 
>>>> ralph.goers @dslextreme.com wrote:
>>>>> 
>>>>> Then to write to the second log you will need to write your own Layout
>>>>> and
>>>>> parse out what you want from the message.
>>>>> 
>>>>> Ralph
>>>>> 
>>>>> On Nov 21, 2011, at 8:31 AM, Kikou1984 wrote:
>>>>> 
>>>>>> 
>>>>>> Hi ,
>>>>>> 
>>>>>> thank u for u r anserw, I have to work with the existing log.
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> ralph.goers @dslextreme.com wrote:
>>>>>>> 
>>>>>>> Do you have the ability to modify the program or do you have
to work
>>>>>>> with
>>>>>>> the existing log that is being generated?
>>>>>>> 
>>>>>>> Ralph
>>>>>>> 
>>>>>>> On Nov 21, 2011, at 6:41 AM, Kikou1984 wrote:
>>>>>>> 
>>>>>>>> Hello, I got a program , it uses log4J for creating log.
Exemple :
>>>>>>>> log.info("[SUIVI_TRT] [TrtStart : UPDATE_BORDERO]" + " [InputFile="
>>>>>>>> +
>>>>>>>> args[2] + "] [ParamFile=" + args[1] + "] [OutputPath="+args[3]+"]
>>>>>>>> [mode="
>>>>>>>> +args[0]+"]" +"[XmlConfigMail =" + args[4] + "]"); I would
like to
>>>>>>>> create
>>>>>>>> another Log, which contains only Log with this String
>>>>>>>> "[SUIVI_TRT]".
>>>>>>>> Is
>>>>>>>> it possible ?!! 
>>>>>>>> View this message in context: Find word in log
>>>>>>>> Sent from the Log4j - Dev mailing list archive at Nabble.com.
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> -- 
>>>>>> View this message in context:
>>>>>> http://old.nabble.com/Find-word-in-log-tp32870799p32871018.html
>>>>>> Sent from the Log4j - Dev mailing list archive at Nabble.com.
>>>>>> 
>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> -- 
>>>> View this message in context:
>>>> http://old.nabble.com/Find-word-in-log-tp32870799p32871053.html
>>>> Sent from the Log4j - Dev mailing list archive at Nabble.com.
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> 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
>>> 
>>> 
>>> 
>> 
>> -- 
>> View this message in context:
>> http://old.nabble.com/Find-word-in-log-tp32870799p32871125.html
>> Sent from the Log4j - Dev mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Find-word-in-log-tp32870799p32872201.html
Sent from the Log4j - Dev mailing list archive at Nabble.com.


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


Mime
View raw message