Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/born2snipe/maven-custom-logging
attempt to customize/modify Maven 3 logging
https://github.com/born2snipe/maven-custom-logging
java logging maven
Last synced: 2 months ago
JSON representation
attempt to customize/modify Maven 3 logging
- Host: GitHub
- URL: https://github.com/born2snipe/maven-custom-logging
- Owner: born2snipe
- License: other
- Created: 2013-04-12T04:20:37.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-07-10T01:13:19.000Z (over 9 years ago)
- Last Synced: 2024-04-16T07:04:28.322Z (9 months ago)
- Topics: java, logging, maven
- Language: Java
- Size: 457 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Maven Custom Logging
This is a maven extension that allows some customization of the maven console output.
![sampleoutput](http://i.imgur.com/yYa5Ocv.gif)
## Features
- Remove the log threshold from the output (ie. `[INFO]`)
- Prepend a timestamp to each log line
- Coloring of whole lines or segments of lines using the [JANSI](https://github.com/fusesource/jansi) library
- Alter text output or remove output## Setup
- Download the [3.0 or 3.1][4] JAR to your `$MAVEN_HOME/lib/ext` directory
- Run any maven build you would like and you should see some colors!## How to use my own configuration?
There are 4 different ways for you to supply a custom configuration file:
- supply this system property `custom.logging.configuration` at the commandline, with a value pointing to your config file
- supply the environment variable `MAVEN_CUSTOM_LOGGING_CONFIG` and put the path to your config file as it's value
- put config file `maven-custom-logging.yml` in your `$MAVEN_HOME/conf` directory
- put config file `maven-custom-logging.yml` in your `$HOME` directory#### Note: [Sample Configuration File][1]
## FAQ
- **Lines I am attempting to color are not being colored?**
- This can be caused by your regex pattern being incorrect
- This can be caused by a maven plugin that is running in your build decided to not use Maven's Logger
- This can be caused by a maven plugin that has switched out the `System.out` to a different instance *(ie. maven-surefire-plugin)*
- This can be caused by the output being sent to a [file](https://github.com/fusesource/jansi/blob/master/jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java#L66)- **What colors/options are available for the `render` configuration?**
- Colors and Options available are [here][2]
- Examples of render syntax is [here][3]- **How can I see phases of the filtering of the log lines?**
- If you specify the `-Dcustom.logging.debug` switch at the commandline this will put custom logging into debug mode and A LOT of information will be printed.
- This will show the before and after of each log line we filtered- **How can I temporary shutoff the log filtering?**
- Just supply `custom.logging.off` system property and you should see all the original maven output## Maven versions Tested and working
- [x] 3.0.1
- [x] 3.0.2
- [x] 3.0.3
- [x] 3.0.4
- [x] 3.0.5
- [X] 3.1.0
- [X] 3.1.1
- [X] 3.2.1
- [X] 3.2.2
- [X] 3.2.3
- [X] 3.3.1
- [X] 3.3.3[1]: https://github.com/born2snipe/maven-custom-logging/blob/master/custom-logging/src/main/resources/config/default.yml "sample"
[2]: https://github.com/fusesource/jansi/blob/master/jansi/src/main/java/org/fusesource/jansi/AnsiRenderer.java#L127 "colors"
[3]: https://github.com/fusesource/jansi/blob/master/jansi/src/test/java/org/fusesource/jansi/AnsiRendererTest.java "syntax"
[4]: https://github.com/born2snipe/maven-custom-logging/releases/tag/v0.1 "release"