-
Notifications
You must be signed in to change notification settings - Fork 42
Updates Migrate4_5_2.java to allow for log4j2 properties files not being present #129
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
Updates Migrate4_5_2.java to allow for log4j2 properties files not being present #129
Conversation
8ae1a66 to
c856702
Compare
pacmano1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this code write some log event somewhere on skipping?
mgaffigan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem right: the file is in the setup conf directory, and this migration seems to be the dual of 249b900. UTF-8 is not the default for appender.console.layout.charset. How are we assuming the install got to this state?
Perhaps the file should be created if it is not present? At a minimum, I would presume a warning would be called for.
Verify that log4j2.properties and log4j2-cli.properties files exist before attempting to update them. These files are not strictly required. Log an INFO level message and continue when not found. Also refactored to elimitate duplication of code. Issue: nextgenhealthcare/connect#6327 Co-authored-by: bfnoling <107218487+bfnoling@users.noreply.github.com> Co-authored-by: Tony Germano <tony@germano.name> Signed-off-by: Richard Ogin <rogin@users.noreply.github.com> Signed-off-by: Tony Germano <tony@germano.name>
c856702 to
db8615f
Compare
tonygermano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated this PR. The original request in the NextGen repo stated that the mirth-cli had been uninstalled from the server install directory, and so the log4j2-cli.properties file was not present.
Technically, even the log4j2.properties file is not strictly required, and migration should not fail if it is missing.
This has been refactored so each file is processed in the same way and migration will progress if either is missing, logging an INFO level message when a file can't be found.
Additionally, it will now only attempt to save the file if it actually made a change to it.
|
Unless I'm misreading this PR, the file is still not created by the migration. Here are my assumptions:
Full testing goes up with I'm not blocking, but I would suggest that the migration should match the change to the file in a new install. |
pacmano1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is OK by me - logging actions was my only ask.
Sorry, I did not see this comment before I merged. It didn't show up in the discord notifications because it wasn't technically a review. This migration is just to impose a new application default, which is different than the log4j2 default, if the user has not previously configured the option. I suppose you could say that deleting the log4j properties file is a user configuration choice? 😄 . The main thing was to not allow the migration to fail because the file was missing. If it was actually the user's intention to use the log4j defaults, then adding all of the application's defaults would be more of a change in behavior than the single setting that the migration is adding. The cli is definitely not required, even though the installer installs it by default. NextGen's official docker image removes the cli application entirely, and they have always made it available as a stand-alone download, which we probably should do as well. There is no reason to install it to the same directory as the server application other than it is a strong indication that the cli version likely matches the server version when you find it there. However, since it is currently bundled and installed there by default and the cli project itself doesn't support migrations, I suppose that is why NG included that file in the server migration. |
Adds null check as property file may not exist.
To Reproduce: upgrade 4.5.1 to 4.5.2 without log4j2-cli.properties in the /conf directory
Related
nextgenhealthcare/connect#6327
Summary table in #121