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

get correlation id in other logger #205

Closed
0x003e opened this issue Feb 11, 2018 · 1 comment
Closed

get correlation id in other logger #205

0x003e opened this issue Feb 11, 2018 · 1 comment

Comments

@0x003e
Copy link

0x003e commented Feb 11, 2018

I use spring boot framework, I think it would be good to share correlation id whit other logger in a same http request context like that:

@RestController
@RequestMapping("/api")
public class UserResource {

    private final Logger log = LoggerFactory.getLogger(UserResource.class);

    @PostMapping("/users")
    @Timed
    public ResponseEntity<User> createUser() throws URISyntaxException {
        log.debug("current correlation id: {}", DefaultLogbook.getGeneratedCorrelationId());
    }
}

What's the best way for that ?

@whiskeysierra
Copy link
Collaborator

@0x003e I believe this is what you're looking for: https://github.com/zalando/tracer

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

2 participants