[jira] Commented: (MNG-519) Timestamps on messages
[ https://jira.codehaus.org/browse/MNG-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=281982#comment-281982 ] Mark Michaelis commented on MNG-519: I am quite satisfied with the [shell script|https://gist.github.com/993139] I am using. Unfortunately it works only on Linux -- maybe with Cygwin, too: {code} #!/bin/bash # # Prepends a date string in front of the Maven output. # A workaround for http://jira.codehaus.org/browse/MNG-519 Timestamps on messages [ -z ${AWK} ] AWK=$(which gawk 2/dev/null) || AWK=$(which awk 2/dev/null) || { echo Error: Could not find AWK tool.; exit 1; } ${AWK} 'BEGIN { print strftime(%Y-%m-%d %H:%M:%S); }' 21 /dev/null || { echo Error: your AWK version does not support strftime() function. exit 1; } mvn ${@} 21 |${AWK} '{ print strftime(%Y-%m-%d %H:%M:%S), $0; fflush(); }' # see comp.unix.shell FAQ: (http://cfajohnson.com/shell/cus-faq-2.html) # How do I get the exit code of cmd1 in cmd1|cmd2 exit ${PIPESTATUS[0]} {code} Follow the link to my [Gist|https://gist.github.com/993139] for the most recent version. Timestamps on messages -- Key: MNG-519 URL: https://jira.codehaus.org/browse/MNG-519 Project: Maven 2 3 Issue Type: New Feature Components: Logging, Plugins and Lifecycle Reporter: Jeff Jensen Priority: Minor Fix For: 3.x / Backlog With current and/or moving forward with M2, I would like an option for timestamped messages. We have a somewhat long nightly process. I regularly wish for timestamps on the log messages from the Maven build. The two primary reasons for this are duration calculation - how long did something take, and an occasional correlation with an outside event. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-519) Timestamps on messages
[ https://jira.codehaus.org/browse/MNG-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=281976#comment-281976 ] Alex Ioffe commented on MNG-519: How do you perform the above workaround for maven 3.0.3??? Timestamps on messages -- Key: MNG-519 URL: https://jira.codehaus.org/browse/MNG-519 Project: Maven 2 3 Issue Type: New Feature Components: Logging, Plugins and Lifecycle Reporter: Jeff Jensen Priority: Minor Fix For: 3.x / Backlog With current and/or moving forward with M2, I would like an option for timestamped messages. We have a somewhat long nightly process. I regularly wish for timestamps on the log messages from the Maven build. The two primary reasons for this are duration calculation - how long did something take, and an occasional correlation with an outside event. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-519) Timestamps on messages
[ https://jira.codehaus.org/browse/MNG-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=275668#comment-275668 ] Scott MacDonald commented on MNG-519: - I'm not sure what is more amazing...That maven does not support timestamped logs, or that I have been a maven user for so many years and only just noticed. Timestamps on messages -- Key: MNG-519 URL: https://jira.codehaus.org/browse/MNG-519 Project: Maven 2 3 Issue Type: New Feature Components: Logging, Plugins and Lifecycle Reporter: Jeff Jensen Priority: Minor Fix For: 3.x / Backlog With current and/or moving forward with M2, I would like an option for timestamped messages. We have a somewhat long nightly process. I regularly wish for timestamps on the log messages from the Maven build. The two primary reasons for this are duration calculation - how long did something take, and an occasional correlation with an outside event. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-519) Timestamps on messages
[ http://jira.codehaus.org/browse/MNG-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=187084#action_187084 ] Julien HENRY commented on MNG-519: -- I second this request. I want to find what part of the build is consuming time. And the work-around seems not possible with Continuum. Timestamps on messages -- Key: MNG-519 URL: http://jira.codehaus.org/browse/MNG-519 Project: Maven 2 Issue Type: Wish Components: Logging, Plugins and Lifecycle Reporter: Jeff Jensen Priority: Minor Fix For: 3.x With current and/or moving forward with M2, I would like an option for timestamped messages. We have a somewhat long nightly process. I regularly wish for timestamps on the log messages from the Maven build. The two primary reasons for this are duration calculation - how long did something take, and an occasional correlation with an outside event. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-519) Timestamps on messages
[ http://jira.codehaus.org/browse/MNG-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=187095#action_187095 ] Julien HENRY commented on MNG-519: -- I think I have a better workaround. 1) Edit $MAVEN_HOME/lib/maven-2.2.1-uber.jar!org/codehaus/plexus/plexus-bootstrap.xml Replace: {code} component roleorg.codehaus.plexus.logging.LoggerManager/role implementationorg.codehaus.plexus.logging.console.ConsoleLoggerManager/implementation lifecycle-handlerbasic/lifecycle-handler configuration thresholdinfo/threshold /configuration /component {code} by {code} component roleorg.codehaus.plexus.logging.LoggerManager/role implementation org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager /implementation /component {code} 2) Download and move into $MAVEN_HOME/lib: plexus-slf4j-logging-1.1-alpha-1.jar slf4j-api-1.5.8.jar And also the slf4j implementation you want to use (in my case it is logback): logback-core-0.9.15.jar logback-classic-0.9.15.jar 3) To configure logback you can use a logback.xml file. The only trick is that Maven loader will only pick JAR file in /lib folder so you can simply create a new JAR containing only logback.xml For example here is my logback.xml: {code} ?xml version=1.0 encoding=UTF-8 ? !-- Logback configuration file -- configuration appender name=STDOUT class=ch.qos.logback.core.ConsoleAppender layout class=ch.qos.logback.classic.PatternLayout !--Pattern%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n/Pattern-- Pattern%-5level %d{HH:mm:ss.SSS} %msg%n/Pattern /layout /appender root level value=INFO / appender-ref ref=STDOUT / /root /configuration {code} And finally: {code} mvn clean INFO 15:01:32.785 Scanning for projects... INFO 15:01:32.972 Reactor build order: ... ... INFO 15:01:34.082 INFO 15:01:34.082 BUILD SUCCESSFUL INFO 15:01:34.082 INFO 15:01:34.097 Total time: 1 second INFO 15:01:34.097 Finished at: Fri Aug 14 15:01:34 CEST 2009 INFO 15:01:34.160 Final Memory: 7M/13M INFO 15:01:34.160 There was no such logger 'org.apache.maven.artifact.metadata.ArtifactMetadataSource:maven' 18061339. There was no such logger 'org.apache.maven.plugin.PluginMappingManager' 18061339. There was no such logger 'org.apache.maven.artifact.resolver.ArtifactResolver' 18061339. There was no such logger 'org.apache.maven.artifact.transform.ArtifactTransformation:snapshot' 18061339. There was no such logger 'org.apache.maven.profiles.MavenProfilesBuilder' 18061339. {code} There are two issues with this solution: 1) The -X flag does nothing. You have to manually update logback.xml to change INFO to DEBUG. 2) I don't know why there is the lines: {code} There was no such logger 'org.apache.maven.profiles.MavenProfilesBuilder' 18061339. {code} at the end... Hope that help. Timestamps on messages -- Key: MNG-519 URL: http://jira.codehaus.org/browse/MNG-519 Project: Maven 2 Issue Type: Wish Components: Logging, Plugins and Lifecycle Reporter: Jeff Jensen Priority: Minor Fix For: 3.x With current and/or moving forward with M2, I would like an option for timestamped messages. We have a somewhat long nightly process. I regularly wish for timestamps on the log messages from the Maven build. The two primary reasons for this are duration calculation - how long did something take, and an occasional correlation with an outside event. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-519) Timestamps on messages
[ http://jira.codehaus.org/browse/MNG-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=187098#action_187098 ] Jeff Jensen commented on MNG-519: - Good idea. Additionally, if Maven could use a property for the pattern with a default, such as this example logback pattern, {code:xml} pattern${maven.logger.pattern:-%date %contextName [%thread] %-5level %-40logger{40} %mdc: %marker: %msg%n}/pattern {code} users can then easily set it. Timestamps on messages -- Key: MNG-519 URL: http://jira.codehaus.org/browse/MNG-519 Project: Maven 2 Issue Type: Wish Components: Logging, Plugins and Lifecycle Reporter: Jeff Jensen Priority: Minor Fix For: 3.x With current and/or moving forward with M2, I would like an option for timestamped messages. We have a somewhat long nightly process. I regularly wish for timestamps on the log messages from the Maven build. The two primary reasons for this are duration calculation - how long did something take, and an occasional correlation with an outside event. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-519) Timestamps on messages
[ http://jira.codehaus.org/browse/MNG-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=136068#action_136068 ] Jerome Lacoste commented on MNG-519: As a work-around it is possible to pipe the output to a script that will add the timestamp for you. On Linux, you can use the ts perl script. Timestamps on messages -- Key: MNG-519 URL: http://jira.codehaus.org/browse/MNG-519 Project: Maven 2 Issue Type: Wish Components: Plugins and Lifecycle Reporter: Jeff Jensen Priority: Minor Fix For: 2.x With current and/or moving forward with M2, I would like an option for timestamped messages. We have a somewhat long nightly process. I regularly wish for timestamps on the log messages from the Maven build. The two primary reasons for this are duration calculation - how long did something take, and an occasional correlation with an outside event. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira