remove stacktrace from logging

Hi,

i am just looking through the liquibase source to improve logging. For that i extended SpringLiquibase to do some things better than the standard bean. But i have an issue with that line in ChangeSet.java:

log.severe("Change Set " + toString(false) + " failed. Error: " + e.getMessage(), e);

The logging message itself is nice and i can nicely put that into my own log file via log4j.xml. But appending the exception to the logging results in a StackTrace in the log which distracts from the “important” liquibase informations. No one cares about the stack at this point. All matters is what the liquibase issue is and this is logged perfectly.

A few lines above, we have this line, which is how it should be elsewhere too:

log.info("Change set " + toString(false) + " failed, but failOnError was false. Error: " + e.getMessage());

So can anybody with commit rights fix this? Would be very nice. IMO the first line is a bad practice when it comes to logging.


        

I would suggest that there are times where each is appropriate. I will take a look at this class and submit a pull request that does both things - log the info-level stuff at info level, and if there is a problem log the stacktrace at debug level.

Also, Nathan is very open to pull requests - if you find things you want to improve, by all means submit a pull request! If you are not familiar with the github workflow, the basic idea is that you create a fork of the repository in your own github account, make the changes you want, and then use github to submit a pull request. Nathan can then review the request, make comments on it, and when everyone agrees it looks good, he can merge it in to the main codeline. Once you’ve done it and seen how easy it is, it is pretty magical.

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

I don’t use intelliJ, so I don’t know what sorts of ‘weird stuff’ you may be encountering. Nathan does, but it has probably been a while since he started with a clean checkout. The lowest common denominator, build-wise, is maven. In theory (I haven’t tested it lately) one should be able to clone from github and run ‘mvn install’ and get working binaries.

Can you document the problems you ran into? Ideally those would go into Liquibase Jira, and any issue would have the 3 key parts of a bug report

  1. This is what I did

  2. This is what actually happened

  3. This is what I expected to happen

https://liquibase.jira.com/projects/CORE/summary

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

just to add one more argument to my case. After the mentioned log line, an Exception will be thrown. This exception goes the whole stack up to the appServer. This causes a stacktrace to be printed anyway to stdout.

Update: i know github of course… just didnt know that liquibase is on github, Will make a pull request. Thanks.

here we go: https://github.com/liquibase/liquibase/pull/521

BTW i just checked out master and imported to intellij. There is plenty of weird stuff up to the point that its not compileable. I cant even get GIT Plugin working on all directories with the current project setup.