Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[all] Use slf4j #896

Closed
8 tasks done
Tracked by #2524
adangel opened this issue Feb 1, 2018 · 4 comments · Fixed by #3789
Closed
8 tasks done
Tracked by #2524

[all] Use slf4j #896

adangel opened this issue Feb 1, 2018 · 4 comments · Fixed by #3789
Assignees
Labels
an:enhancement An improvement on existing features / rules dependencies Pull requests that update a dependency file in:pmd-internals Affects PMD's internals
Projects
Milestone

Comments

@adangel
Copy link
Member

adangel commented Feb 1, 2018

Part of #2524

Rationale: In order to make it easier to integrate PMD into other tools, it might be better to use the de-facto-standard slf4j.
We could then provide some basic simplelogger configuration in our binary distribution, but integrations have full freedom on which logging framework they want to use.

This would at slf4j-api as an additional compile-time dependency and maybe slf4j-impl as runtime dependency in our pmd-bin-xxx.zip distribution.

Currently we are using java util logging.

Tasks:

  • Decide on the logging backend (log4j, logback, ...) and provide a default runtime + test
    configuration
  • Integrate it into the CLI flags (-debug)
  • Fix dist (add missing dependency, provide default simplelogger.properties)
  • Test dist
  • Fix ant (AntLogger)
  • Remove logback-classic from apex-jorje
  • Create a custom PMD rule to avoid usage of java.util.logging - only slf4j should be allowed. In build-tools.
  • Refactor logging statements (split into tasks/PRs for each pmd module)
@adangel adangel added the a:RFC A drafted proposal on changes to PMD, up for feedback form the team and community label Feb 1, 2018
@jsotuyod
Copy link
Member

jsotuyod commented Feb 1, 2018

@adangel I totally support this, I think it's the most versatile approach. Also, the use of placeholders ({}) along with variable argument lists, can let us avoid guarding log statements, which may clean up the code a little bit without any performance cost.

We may have trouble with things such as Jorje internally using java util logging, although we are currently silencing some of it's output, so it may not be an issue.

However, this may imply changes on how tools integrate with PMD, so maybe this should be part of 7.0.0?

@adangel adangel added this to the 7.0.0 milestone Feb 19, 2018
@adangel
Copy link
Member Author

adangel commented Feb 19, 2018

Yes, probably something for a major version change. Also the command line output (format) might change.

By the way - it's no problem to integrate j.u.logging into slf4j. I did the same for the latest m-pmd-p, where I redirect PMD's logging into maven (https://github.com/apache/maven-pmd-plugin/blob/ffa915f02bc70a9eaea57a24093169e589e8e8be/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java#L547)

@jsotuyod jsotuyod added an:enhancement An improvement on existing features / rules in:pmd-internals Affects PMD's internals and removed a:RFC A drafted proposal on changes to PMD, up for feedback form the team and community labels Feb 20, 2018
@jsotuyod jsotuyod changed the title [RFC] Use slf4j [all] Use slf4j Feb 20, 2018
@adangel adangel mentioned this issue May 23, 2020
6 tasks
@adangel adangel self-assigned this Jan 27, 2022
@adangel adangel added this to In progress in PMD 7 Jan 27, 2022
adangel added a commit to pmd/build-tools that referenced this issue Feb 17, 2022
@adangel adangel linked a pull request Feb 17, 2022 that will close this issue
9 tasks
adangel added a commit to adangel/pmd that referenced this issue Feb 18, 2022
@oowekyala oowekyala moved this from In progress to Done in PMD 7 Mar 8, 2022
@oowekyala oowekyala mentioned this issue Apr 7, 2022
55 tasks
@adangel adangel mentioned this issue Jun 24, 2022
4 tasks
@jsotuyod
Copy link
Member

@adangel / @oowekyala any reason why this task is still open? I don't see any pending task in the description.

@oowekyala oowekyala added the dependencies Pull requests that update a dependency file label Aug 4, 2022
@adangel
Copy link
Member Author

adangel commented Jan 13, 2023

This is done for PMD7 via #3789

@adangel adangel closed this as completed Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
an:enhancement An improvement on existing features / rules dependencies Pull requests that update a dependency file in:pmd-internals Affects PMD's internals
Projects
No open projects
PMD 7
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants