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

Update to log4j2 #316

Merged
merged 6 commits into from
Dec 16, 2022
Merged

Update to log4j2 #316

merged 6 commits into from
Dec 16, 2022

Conversation

taba90
Copy link
Contributor

@taba90 taba90 commented Nov 15, 2022

  • update dependencies to log4j2.
  • update the java classes Logger usage to match log4j2 api.
  • migrate log4j.properties to log4j2.properties

This shows the geostore logs at debug level on console appender:
geostore-logs

The following is from a log file when using file appender (with mapstore):

INFO   2022-11-16 15:17:14.173   RESTServiceImpl.extractAuthUser() - Accessing service with user admin and role ADMIN 
WARN   2022-11-16 15:17:14.175   QueryTranslatorImpl.list() - HHH000104: firstResult/maxResults specified with collection fetch; applying in memory! 
WARN   2022-11-16 15:17:14.175   QueryTranslatorImpl.list() - HHH000104: firstResult/maxResults specified with collection fetch; applying in memory! 
DEBUG   2022-11-16 15:17:14.176   SearchConverter.convert() - TRG Search  --> Search(class it.geosolutions.geostore.core.model.Resource)[first: -1, page: -1, max: -1] {
 resultMode: AUTO,
 disjunction: false,
 fields: {  },
 filters: {
  (some `attribute` {(`name` = "featured" and `textValue` = "true")})
 },
 sorts: {  }
} 
WARN   2022-11-16 15:17:14.176   QueryTranslatorImpl.list() - HHH000104: firstResult/maxResults specified with collection fetch; applying in memory! 
DEBUG   2022-11-16 15:17:14.183   BaseSearchProcessor.generateQL() - generateQL:
  select distinct _it from it.geosolutions.geostore.core.model.Resource _it left join fetch _it.security as a1_security where exists (from _it.attribute _it1 where (_it1.name = :p1 and _it1.textValue = :p2)) order by _it.name asc 
DEBUG   2022-11-16 15:17:14.189   JPASearchProcessor.addParams() - p1: "featured"
	p2: "true" 
WARN   2022-11-16 15:17:14.189   QueryTranslatorImpl.list() - HHH000104: firstResult/maxResults specified with collection fetch; applying in memory! 
DEBUG   2022-11-16 15:17:14.203   SearchConverter.convert() - TRG Search  --> Search(class it.geosolutions.geostore.core.model.Resource)[first: -1, page: -1, max: -1] {
 resultMode: AUTO,
 disjunction: false,
 fields: {  },
 filters: {
  (`category.name` = "MAP" and `name` ILIKE "%%%")
 },
 sorts: {  }
} 
DEBUG   2022-11-16 15:17:14.204   BaseSearchProcessor.generateRowCountQL() - generateRowCountQL:
  select count(_it) from it.geosolutions.geostore.core.model.Resource _it left join _it.category as a1_category where (a1_category.name = :p1 and lower(_it.name) like lower(:p2)) 

Copy link
Member

@aaime aaime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes look pretty obvious to me. That said, I have no experience with GeoStore, so I can't say if there is anything else that needed to be modified.

@@ -27,7 +27,8 @@
*/
package it.geosolutions.geostore.services.rest.auditing;

import org.apache.log4j.Logger;
import org.apache.logging.log4j.LogManager;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import does not really seem to be in use (mass update/replace I presume)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -694,6 +704,12 @@
<groupId>org.acegisecurity</groupId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acegi? Ouch this is pretty darn old. How does it work if you remove log4j classic? Is it going through a logger facade library? Did you provide the right binding jars for it? (it's so old it might be using commons-logging)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acegi is need for jasypt 1.8 whom encoder implements its interface. Removing that jar is not a straight forward thing since it is required to modifies the geostore password encoder: jasypt 1.9 seems to be not backward compatible

@taba90 taba90 merged commit 6b0bedc into geosolutions-it:master Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants