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.

Provide a way to customize default `serviceName` in RequestLog

See original GitHub issue

The default serviceName of a service is an FQCN of the innermost class. And a serviceName could get overridden by ctx.logBuilder().name(serviceName, methodName). Sometimes, users want to globally change the serviceName convention to a simple name of the innermost class.

We might provide an option to ServerBuilder such as:

Server.builder()
     .serviceNaming(serviceName -> {
          var lastDotIndex = serviceName.lastIndexOf('.');
          if (lastDotIndex > -1) {
              return serviceName.substring(lastDotIndex, serviceName.length());
          }
          ...
     });

And we can also provide a built-in abbreviation algorithm like logback’s Conversion Word.

ServiceNameRule.shorten(15);

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
hexoulcommented, May 6, 2021

Can we close this issue? @ikhoon

1reaction
hexoulcommented, Feb 10, 2021

ServerBuilder.serviceNaming()

I see. It seems that I unnecessarily worried layered serviceNaming. Agreed that the suggestion makes the problem simple and reduce confusion. Let me try with that way. Thanks. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Dropwizard Configuration Reference
By default, the timestamp is not formatted. To customize how timestamps are formatted, set the property to the corresponding DateTimeFormatter string or one...
Read more >
Schema Registry Configuration Options
The advertised host name. Make sure to set this if running Schema Registry with multiple nodes. Type: string; Default: “192.168.50.1”; Importance: high.
Read more >
Logging and viewing logs | Cloud Run Documentation
This page describes the logs available when using Cloud Run, and how to view and write logs. Cloud Run has two types of...
Read more >
Logger - AWS Lambda Powertools for Python
Logging level, Sets how verbose Logger should be (INFO, by default), LOG_LEVEL, level. Service, Sets service key that will be present across all...
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