• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Maven Logging Custom output to a file

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi rancher,
I am a newbie here and to Maven. I am trying to figure how i can log execution details into a log file. Also, If I want to out some values like version, release number, execution status and details incase of failure. How can I do this? Any guidance will help.

I dont want to use mvn clean install > file.log

Is there a maven way of doing this.

Thanks in advance.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried running "mvn -?" to see what all of the options are. Do that and take a look at the -l option, perhaps that will do what you want.

Other than that, the only options you have are levels of detail on the output, with the current set of output being one option, and the -X being the other. If you really want to get only those items mentioned, you will have to parse the log output.
 
bhuvan emmandi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI Peter,
Thanks for the quick reply. As I told you, I am new to Maven, going through the documentation as well. I will try your suggestions and see if that helps.
 
bhuvan emmandi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,
This helps me to output the execution log but does not give me handle to echo my own message during execution. I want to echo some message like

"date projectxyz {status:true, msg:"success or fail message"}"

is this possible in maven?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is nothing like that built into Maven, but I did find a plugin that will do that:
http://code.google.com/p/maven-echo-plugin/

If you need anything more specific you might have to write your own plugin.
 
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic