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
Improve the logging during image import (see #11020) #1251
Conversation
I've checked this against gretzky and I am getting nicely full logs for a handful of image and SPW formats. The one thing I noticed is that the import log contains only DEBUG level messages. I don't know if this means the filter is too strict or if messages levels are being rewritten or if the logs genuinely do only have that data in them. |
@ximenesuk Currently |
Changed the filter settings so that it catches both |
Interesting. I would think we want DEBUG and higher always. I can't think of a case where we would want, say, |
@joshmoore So we want DEBUG, INFO, WARN and ERROR in the import log file, yes? If so, then the |
Sounds like a plan. |
Apologies, @bpindelski . I didn't get to this today. Re-adding for tomorrow. |
This looks great. Tested via:
The following categories look to be a bit much at DEBUG and could be limited to INFO:
@melissalinkert, do you have any thoughts on what we want/need from |
@@ -52,10 +53,18 @@ public Object invoke(final MethodInvocation arg0) throws Throwable { | |||
final Map<String, String> ctx = current.ctx; | |||
if (ctx != null && ctx.size() > 0) { | |||
cd.setContext(ctx); | |||
if (ctx.containsKey("omero.logfilename")) { | |||
MDC.put("fileset", ctx.get("omero.logfilename")); |
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.
We'll need some ideas on how to limit the scope of this, since at the moment anyone will be able to write to whatever log file they like just by passing a value.
Final question, perhaps for @ximenesuk & another PR: what if any of the lines are being duplicated to |
Having |
@bpindelski : could you lower to |
@joshmoore Updated |
Looking through the logs from today's auto-import:
the files look not overly full with DEBUG but generally usable. There was at least one exception which it would be interesting to look into further (i.e. good data). It's nice that we now have the timestamps for all the actions, which we could optionally start parsing out at some point. 👍 |
@@ -19,6 +19,12 @@ | |||
<pattern>%date %-5level [%40.40logger{40}] \(%10.10thread\) %msg%n</pattern> | |||
</encoder> | |||
|
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
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.
@bpindelski: sorry, I missed this while focusing on the import logs. Was this supposed to be changed to a ThresholdFilter
?
Tested on gretzky and locally. Both |
Improve the logging during image import (see #11020)
@@ -219,6 +219,7 @@ | |||
import omero.util.TempFileManager; | |||
|
|||
import org.apache.commons.io.FilenameUtils; | |||
import org.apache.log4j.MDC; |
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 should be:
import org.slf4j.MDC;
A bit late for this PR but I'll reference this minor change to an ongoing ticket so it can be included in a suitable PR.
This PR extends the contents of the import log file created during the upload/import phase. The file can be accessed after the import finishes in Insight (using the
View
button).The
logback.xml
configuration modifications might slightly affectBlitz-0.log
and friends (after local comparison, the contents of those log files should be roughly the same before this PR and after).To test - upload images (different types) and view the import log file - contents should be quite verbose (messages of levels: DEBUG, INFO, WARN and ERROR - latter two not always present).