Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I set a reasonable time format for Java logging entries in Crowd 3?

Hello!

In Crowd 2 I could simply add to apache-tomcat/conf/logging.properties the line

    < 1catalina.java.util.logging.SimpleFormatter.format=%1$tF %1$tT %2$s%n%4$s: %5$s%6$s%n

and I had a time format that I could understand. Crowd 3 looks pretty different. Where and how can I set here a reasonable time format for logging?

--

Greetings

   Pete

 

1 answer

0 votes
Marcin Kempa Atlassian Team Mar 14, 2018

Hi @iron.werther

In Crowd 3.x we've updated version of Tomcat which is bundled inside Crowd from 7.x to 8.5.x

In Tomcat 7, the log format configuration looked like:

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

thus by changing the

1catalina.java.util.logging.SimpleFormatter.format

you could adjust the date format in logs.

 

In newer version of Tomcat (8.5.x bundled in Crowd 3.x) this config looks like:

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter

notice that the formatter has changed.

I believe you may try to change the time format in logs by adjusting the tomcat's logging config as follows:

java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
org.apache.juli.OneLineFormatter.timeFormat = yyyy-MM-dd HH:mm:ss

(the timeFormat - is using the SimpleDateFormat syntax)

Unfortunately I did not test that on a working Crowd version, this is what I got by following the Apache Tomcat docs.

 

Hope that helps,

Marcin Kempa

Hello Marcin!

The migration from Crowd 2.12.0 to version 3.1.2 fails every time, but at least I can see that the log files contain a reasonable date format. (Which I might adjust later, now that I know where to perform this task.)

 

Thank you!

--

Pete

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

⏰ Day in the life of a Jira Admin!

Hello Community! We thoroughly enjoyed this just-for-fun conversation in the Jira Admin Group about what it's like to be a Jira Admin. For #JiraJuly, our talented designers created these graphics t...

924 views 2 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you