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

[BUG] logger instance in a Filter step is object of class org.apache.logging.log4j.core.Logger while logger instance in Transformer step is instance of org.apache.log4j.Logger #5607

Closed
nicovn opened this issue Jan 3, 2023 · 4 comments
Labels
bug Something isn't working Internal-Issue-Created An issue has been created in NextGen's internal issue tracker RS-9939 triaged

Comments

@nicovn
Copy link

nicovn commented Jan 3, 2023

logger instance in a Filter step is object of class org.apache.logging.log4j.core.Logger while logger instance in Transformer step is instance of org.apache.log4j.Logger

logger.info("logger class name: " + logger.class.getCanonicalName());

Expected behavior
Consistent object classes

Versions
Mirth Connect Version 4.0.0 and higher

Workaround(s)
var log4jv1logger = Packages.org.apache.log4j.Logger.getLogger("filter");
log4jv1logger.info("Logging in filter with log4j v1 class type");

@nicovn nicovn added the bug Something isn't working label Jan 3, 2023
@nicovn
Copy link
Author

nicovn commented Jan 3, 2023

Caused by - JavaScriptBuilder.java - line 331

builder.append(" phase[0] = 'transformer'; logger = Packages.org.apache.log4j.Logger.getLogger(phase[0]);");

@jonbartels
Copy link
Contributor

jonbartels commented Jan 3, 2023

What is the impact of this bug? Does it prevent calling logger in filter steps?

@nicovn
Copy link
Author

nicovn commented Jan 5, 2023

No impact inside Mirth Connect itself, only if you pass the "logger" instance to a custom Java component you get a different object class than in the prior Mirth versions (only from within a filter step, in a transformer script the behavior is like in pre 4.x versions).

@lmillergithub lmillergithub added triaged Internal-Issue-Created An issue has been created in NextGen's internal issue tracker RS-9939 labels Jan 11, 2023
@lmillergithub
Copy link
Collaborator

We reviewed this issue and after further investigation, we found that we intentionally implemented it this way. Therefore, we are closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Internal-Issue-Created An issue has been created in NextGen's internal issue tracker RS-9939 triaged
Projects
None yet
Development

No branches or pull requests

3 participants