question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `RequestLog.serviceName()`

See original GitHub issue

RequestLog.name() was a great addition that provides a universal human-readable name of a request. However, it currently only reveals a method name. It would be nice if we also provide a similar API for getting the name of a service. For example:

Server.builder()
      .route()
          ...
          .defaultServiceName("MyService")
          .build(myService)
      .annotatedService()
          ...
          .defaultServiceName("MyService2")
          .build(myAnnotatedService)
      ...

If not specified, it could be auto-generated from the innermost class name, etc.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ikhooncommented, Jun 4, 2020

Had chat on methodName() and not all services has method name such as:

Server.builder()
      .service((ctx, req) -> {
          ...
          return HttpResponse.of(...);
      });
  • RequestLog.serivceName() that returns an RPC service name or innermost class name for an annotated service.
  • RequestLog.name() that returns only a method name or null if it is a plain Service.
  • RequestLog.fullName() that returns a combined service and name. (ex: com.foo.bar.Service/method)
0reactions
ikhooncommented, Jun 4, 2020

Do we need a new field in RequestLog or should we just prepend service name to name? I think a dedicated field is better for now.

I prefer having dedicated fields. My suggestions are:

  • RequestLog.serivceName() that returns an RPC service name or innermost class name for an annotated service.
  • RequestLog.methodName() that returns only a method name.
  • RequestLog.name() that returns a combined service and method name. For example com.foo.bar.Service/method.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Dropwizard Configuration Reference
Request Log . The new request log uses the logback-access library for processing request logs, which allow to use an extended set of...
Read more >
0.99.7 Milestone · GitHub
Add @ServiceName annotation for annotated service ... Add onResponseTrailers() to circuit breaker and retry rule builders ... Add RequestLog.serviceName() ...
Read more >
Logging - JFrog Documentation
Main service log file for each microservice, containing data on the service activity. Request Log. <service-name>-request.log. For example: ...
Read more >
org.eclipse.jetty.server.NCSARequestLog java code examples
This RequestLog implementation outputs logs in the pseudo-standard NCSA common log format. Configuration options allow a choice between the standard Common Log ...
Read more >
How to group related request log entries GAE python 3.7 ...
Client() # This is the resource type of the log log_name ... (This answer addresses how to add logging severity to Cloud Functions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found