[MAGNOLIA-6794] Upgrade log4j to v 2 Created: 29/Sep/16  Updated: 08/Nov/17  Resolved: 06/Oct/17

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: 5.6

Type: Task Priority: Neutral
Reporter: Jan Haderka Assignee: Dai Ha
Resolution: Done Votes: 2
Labels: tech-debt
Remaining Estimate: 0d
Time Spent: 11d 4.5h
Original Estimate: 5d

Issue Links:
Relates
relates to MGNLADVCACHE-95 Upgrade log4j2 in advanced cache module Closed
relates to JSMODELS-18 Upgrade log4j2 javascript-models Closed
relates to LOGTOOLS-29 Upgrade log4j2 in log-tools Closed
relates to MGNLPN-401 Upgrade log4j2 in personalization module Closed
relates to MGNLSTK-1556 Remove explicit log4j dependency in STK Closed
relates to MGNLLDAP-114 CLONE - Upgrade log4j2 in ldap module Closed
relates to MGNLMAIL-86 Upgrade log4j2 in mail module Closed
duplicate
is duplicated by MAGNOLIA-6881 Switch to log4j2 Closed
relation
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:
Epic Link: Upgrade libraries for 5.6
Sprint: Saigon 113, Saigon 114, Saigon 115, Saigon 116
Story Points: 8

 Description   

1.x is EOL since while
Mind that sfl4j impl is now provided by log4j themselves, no org.slf4j:slf4j-log4j12 anymore.

<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-api</artifactId>
</dependency>
<!-- Use Log4J for logging -->
<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-core</artifactId>
</dependency>
<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-slf4j-impl</artifactId>
</dependency>


 Comments   
Comment by Mikaël Geljić [ 06/Oct/16 ]

Not making it for 5.5, that said we'll have a branch or PR from ngoc.nguyenthanh. Runtime works, but there's more effort needed, in particular for tests, log tools app and other potential usages throughout other modules—details to come.

Meanwhile, current progress is already pretty nice (migrated config and Log4jConfigurer), we will just park it and revive it in due time after 5.5.

Comment by Ngoc Nguyenthanh [ 07/Oct/16 ]

I have created a branch for what I've done

  • Changed dependencies
  • Converted configuration from log4j to new syntax of log4j2 for magnolia-core project and web-app
  • Load log4j2 configuration file and apply at the runtime.

The documentation to describe - https://wiki.magnolia-cms.com/display/DEV/Log4j2+upgrading

Comment by Mikaël Geljić [ 07/Oct/16 ]

Nice recap thanks!

Comment by Richard Unger [ 02/Mar/17 ]

I upgraded the log-tools to work with log4j2:
https://git.magnolia-cms.com/users/runger/repos/log-tools/browse?at=refs%2Fheads%2Flog4j2

Comment by Mikaël Geljić [ 03/Mar/17 ]

Thanks a lot Richard, that's great!
We'll definitely pick it up when we make the switch

Generated at Mon Feb 12 04:17:54 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.