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

Mechanism for sending messages to execution log from Java #112

Closed
wants to merge 7 commits into from

Conversation

bertfrees
Copy link
Member

... using a custom Logback appender that sents log messages to the
EventBus. Attaching the right job ID is done using the same MDC based
principle that was already used in IgnoreSiftAppender.

This fixes issue daisy/pipeline#477

Note that this also follows the proposal of unifying the two types of
messages (execution log and detailed log) through one and the same
mechanism, except that XProc/XSLT messages are still sent directly to
the EventBus: see issue
daisy/pipeline#478.

In order to support messages belonging to one job coming from several
sources, the message sequence numbers are now computed automatically
within MessageBuilder, and the withSequence method has been removed.

using a custom Logback appender that sents log messages to the
EventBus. Attaching the right job ID is done using the same MDC based
principle that was already used in IgnoreSiftAppender.

This fixes issue daisy/pipeline#477

Note that this also follows the proposal of unifying the two types of
messages (execution log and detailed log) through one and the same
mechanism, except that XProc/XSLT messages are still sent directly to
the EventBus: see issue
daisy/pipeline#478.

In order to support messages belonging to one job coming from several
sources, the message sequence numbers are now computed automatically
within MessageBuilder, and the withSequence method has been removed.

@Override
public void start() {
bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way of getting an osgi agnostic appender? If the effort is to big just leave it like that

Copy link
Member Author

@bertfrees bertfrees Jun 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from Slack:

@capitancambio Yes, you're right, and this while we are trying to go in the other direction :). I'm not sure there is a way to avoid it. I couldn't use declarative services because it is a fragment bundle. Maybe the only way is to have several artifacts, one for OSGi, and one for each other dependency injection mechanism you want to use?

@capitancambio
Copy link
Collaborator

I forgot about this bundle being a fragment. I guess it would be reasonable to have different artefacts for different dependency injectors. Although I'd suggest to burn down that bridge when we get to it, the current state is fine for now.

@bertfrees
Copy link
Member Author

Replaced by #127.

@bertfrees bertfrees closed this Dec 19, 2017
@bertfrees bertfrees deleted the job-messages-java branch August 12, 2020 12:33
@bertfrees bertfrees modified the milestone: v1.12.0 Apr 6, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants