Anonymous_User Absent Member.
Absent Member.
200 views

Re: add dates to entries in jbossidm.log?

On 07/20/2012 08:56 AM, jpoisson wrote:
>
> Hello all, currently our User App log is only logging time to each entry
> and i wanted to know if it was possible to preface it with a date as
> well? Maybe there is a defining config file to enable it? any info would
> be great. thank you.
>
>

Greetings,
By default you will have date and time in the log file. This is
normally controlled by the log4j configuration (for example:
jboss-log4j.xml) in the <param name="ConversionPattern" value= /> entry

By Default it will be:

<param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n"/>


It would appear from:
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html

that your %d has been modified to only include time. For example:
%d{HH:mm:ss,SSS}





--
Sincerely,
Steven Williams
Lead Software Engineer
NetIQ


Labels (1)
0 Likes
4 Replies
Anonymous_User Absent Member.
Absent Member.

Re: add dates to entries in jbossidm.log?

On 7/20/2012 8:36 AM, jpoisson wrote:
>
> Excellent. Thank you Steven. Which one would it be though?
> /jboss/server/all/conf/jboss-log4j.xml -
> /jboss/server/default/conf/jboss-log4j.xml - this one should apply to all
> /jboss/server/minimal/conf/jboss-log4j.xml
> /jboss/server/standard/conf/jboss-log4j.xml
> /jboss/server/web/conf/jboss-log4j.xml
> /jboss/server/IDM/conf/jboss-log4jidm/jboss-log4j.xml - this one should apply to the user app instance


So I would go with either default or the last one.
Either should do just fine.

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: add dates to entries in jbossidm.log?

On 07/20/2012 03:55 PM, Will Schneider wrote:
> On 7/20/2012 8:36 AM, jpoisson wrote:
>>
>> Excellent. Thank you Steven. Which one would it be though?
>> /jboss/server/all/conf/jboss-log4j.xml -
>> /jboss/server/default/conf/jboss-log4j.xml - this one should apply to all
>> /jboss/server/minimal/conf/jboss-log4j.xml
>> /jboss/server/standard/conf/jboss-log4j.xml
>> /jboss/server/web/conf/jboss-log4j.xml
>> /jboss/server/IDM/conf/jboss-log4jidm/jboss-log4j.xml - this one
>> should apply to the user app instance

>
> So I would go with either default or the last one.
> Either should do just fine.
>

Greetings,
It is the last one. If examine your start script (start-jboss.sh)
you should see a -c IDM in the exec line. So, we start the IDM
"instance". Therefore all updates need to be under that structure.

--
Sincerely,
Steven Williams
Lead Software Engineer
NetIQ


0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: add dates to entries in jbossidm.log?

On 07/20/2012 04:14 PM, Steven Williams wrote:
> On 07/20/2012 03:55 PM, Will Schneider wrote:
>> On 7/20/2012 8:36 AM, jpoisson wrote:
>>>
>>> Excellent. Thank you Steven. Which one would it be though?
>>> /jboss/server/all/conf/jboss-log4j.xml -
>>> /jboss/server/default/conf/jboss-log4j.xml - this one should apply to
>>> all
>>> /jboss/server/minimal/conf/jboss-log4j.xml
>>> /jboss/server/standard/conf/jboss-log4j.xml
>>> /jboss/server/web/conf/jboss-log4j.xml
>>> /jboss/server/IDM/conf/jboss-log4jidm/jboss-log4j.xml - this one
>>> should apply to the user app instance

>>
>> So I would go with either default or the last one.
>> Either should do just fine.
>>

> Greetings,
> It is the last one. If examine your start script (start-jboss.sh)
> you should see a -c IDM in the exec line. So, we start the IDM
> "instance". Therefore all updates need to be under that structure.
>

Greetings,
I just noticed that you were talking about jboss.log as compared to
the server.log. This is expected behavior and the settings I outlined
do not control this.

The jboss.log is a re-direction of the what would be going to console
(terminal) that you started jboss in.

The server.log will have your date in the time stamps.



--
Sincerely,
Steven Williams
Lead Software Engineer
NetIQ


0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: add dates to entries in jbossidm.log?

On 07/21/2012 12:43 PM, Steven Williams wrote:
> On 07/20/2012 04:14 PM, Steven Williams wrote:
>> On 07/20/2012 03:55 PM, Will Schneider wrote:
>>> On 7/20/2012 8:36 AM, jpoisson wrote:
>>>>
>>>> Excellent. Thank you Steven. Which one would it be though?
>>>> /jboss/server/all/conf/jboss-log4j.xml -
>>>> /jboss/server/default/conf/jboss-log4j.xml - this one should apply to
>>>> all
>>>> /jboss/server/minimal/conf/jboss-log4j.xml
>>>> /jboss/server/standard/conf/jboss-log4j.xml
>>>> /jboss/server/web/conf/jboss-log4j.xml
>>>> /jboss/server/IDM/conf/jboss-log4jidm/jboss-log4j.xml - this one
>>>> should apply to the user app instance
>>>
>>> So I would go with either default or the last one.
>>> Either should do just fine.
>>>

>> Greetings,
>> It is the last one. If examine your start script (start-jboss.sh)
>> you should see a -c IDM in the exec line. So, we start the IDM
>> "instance". Therefore all updates need to be under that structure.
>>

> Greetings,
> I just noticed that you were talking about jboss.log as compared to
> the server.log. This is expected behavior and the settings I outlined
> do not control this.
>
> The jboss.log is a re-direction of the what would be going to console
> (terminal) that you started jboss in.
>
> The server.log will have your date in the time stamps.
>
>
>

Greetings,
I hit send too soon. In the jboss-log4j.xml there are two (2) sections:

<appender name="FILE"
class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${jboss.server.log.dir}/server.log"/>
...

This one has the date and time in the log actions. Which again is
controlled by:

<param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n"/>


The second section:

<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Target" value="System.out"/>
<param name="Threshold" value="INFO"/>

Is not using the date. Here is the setting:

<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>


So, if you want the console (or the jboss.log which is a redirection of
the console) to have date and time then change the %d to match that of
the log file as outlined above.



--
Sincerely,
Steven Williams
Lead Software Engineer
NetIQ


0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.