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

Want to record messageId in log file and administrator dashboard #1

Open
yimengZJl opened this issue Apr 22, 2022 · 2 comments
Open

Comments

@yimengZJl
Copy link

image

@jonbartels
Copy link

jonbartels commented Apr 22, 2022

A workaround for this issue is to call loggers with log.info(channelName + ' Message ID: ' + messageId + ' logging a message and yimeng is awsome!') . This should work with any logging tool because it is manually constructing the log message.

The appender code at

String channelName = uuidMatcher.find() ? ChannelUtil.getChannelName(uuidMatcher.group()) : null;
shows how the MetaAppender extracts the channelId and channelName. Does the raw log message already have messageId present and the MetaAppender just needs to read the value?

My idea is probably wrong. MC puts the channel name into the log by manipulating the thread name Thread.currentThread().setName(mirthServlet.getClass().getSimpleName() + " Thread (" + operation.getDisplayName() + ") < " + originalThreadName);

@odoodo
Copy link
Owner

odoodo commented Nov 30, 2023

Sounds interesting! When the channel is known, it should also be possible to determine the current message ID. If detection is not too expensive, it should be possible to add it to the log entry.

I will have a look into that when I have some time.

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

No branches or pull requests

3 participants