Skip to content

RxJava v1 and v2 hooks which enable SLF4J's MDC propagation.

License

Notifications You must be signed in to change notification settings

puzpuzpuz/rxjava-slf4j-mdc-hook

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rxjava-slf4j-mdc-hook

Build Status Coverage Status

RxJava v1 and v2 hooks which enable SLF4J's MDC propagation.

A fork of bmcstdio/rxjava-slf4j-mdc-hook.

Usage

If you're using RxJava 2:

RxJavaPlugins.setScheduleHandler(new MdcPropagatingOnScheduleFunction());

If you're using RxJava ≥ 1.1.7:

RxJavaHooks.setOnScheduleAction(new MdcPropagatingOnScheduleAction());

If you're using RxJava ≤ 1.1.6:

RxJavaPlugins.getInstance().registerSchedulersHook(new RxJavaSchedulersHook() {
    @Override
    public Action0 onSchedule(final Action0 action) {
        return new MdcPropagatingAction(action);
    }
});

Note: Both RxJavaPlugins#getInstance() and RxJavaSchedulersHook#onSchedule(Action0) are deprecated since 1.1.7.

Binaries

rxjava-slf4j-mdc-hook is available from JCenter:

Gradle:

compile 'io.github.puzpuzpuz:rxjava-slf4j-mdc-hook:1.0.0'

Maven:

<dependency>
  <groupId>io.github.puzpuzpuz</groupId>
  <artifactId>rxjava-slf4j-mdc-hook</artifactId>
  <version>1.0.0</version>
</dependency>

Building

$ git clone https://github.com/puzpuzpuz/rxjava-slf4j-mdc-hook.git
$ cd rxjava-slf4j-mdc-hook
$ ./gradlew build

License

Copyright 2016-2018 brunomcustodio, puzpuzpuz

Licensed under the Apache License, Version 2.0 (the "License").

About

RxJava v1 and v2 hooks which enable SLF4J's MDC propagation.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%