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

Migrate from NCSARequestLog to CustomRequestLog #16416

Closed
wilkinsona opened this issue Apr 2, 2019 · 6 comments
Closed

Migrate from NCSARequestLog to CustomRequestLog #16416

wilkinsona opened this issue Apr 2, 2019 · 6 comments
Assignees
Labels
type: task A general task
Milestone

Comments

@wilkinsona
Copy link
Member

In Jetty 9.4.15, NSCARequestLog has been deprecated and CustomRequestLog introduced as its replacement. We need to migrate to CustomRequestLog, making any necessary property updates when we do so. Assigning to 2.2.x for now but, depending on the updates that are necessary, we may want to do this in one or more of our current maintenance branches.

@wilkinsona wilkinsona added the type: task A general task label Apr 2, 2019
@wilkinsona wilkinsona added this to the 2.2.x milestone Apr 2, 2019
@umeshrawat
Copy link

@wilkinsona Can I take this up?

@wilkinsona
Copy link
Member Author

Thanks for the offer. We're not yet sure what needs to be done. If you'd like to spend some time looking at the differences between NSCARequestLog and CustomRequestLog and seeing how well our current properties map to the latter, that would be much appreciated.

@bclozel
Copy link
Member

bclozel commented May 10, 2019

I've had a look and it seems that all properties related to the RequestLog itself are now gone in favor of the format string. Properties related to the writer are still available.

# Spring Boot support
server.jetty.accesslog.enabled=false # Enable access log.

# Log writer related, still there with RequestLogWriter
server.jetty.accesslog.append=false # Append to log.
server.jetty.accesslog.file-date-format= # Date format to place in log file name.
server.jetty.accesslog.filename= # Log filename. If not specified, logs redirect to "System.err".
server.jetty.accesslog.retention-period=31 # Number of days before rotated log files are deleted.

# All these keys are gone
server.jetty.accesslog.date-format=dd/MMM/yyyy:HH:mm:ss Z # Timestamp format of the request log.
server.jetty.accesslog.extended-format=false # Enable extended NCSA format.
server.jetty.accesslog.locale= # Locale of the request log.
server.jetty.accesslog.log-cookies=false # Enable logging of the request cookies.
server.jetty.accesslog.log-latency=false # Enable logging of request processing time.
server.jetty.accesslog.log-server=false # Enable logging of the request hostname.
server.jetty.accesslog.time-zone=GMT # Timezone of the request log.

I think we should deprecate all the removed keys in favor of new format and customFormat keys:

server.jetty.accesslog.format=NCSA # enum with predefined formats: NCSA, EXTENDED_NCSA
server.jetty.accesslog.custom-format= # String, custom format overriding the former if defined 

The CustomRequestLog javadoc is the reference for this format.

I've got a change (almost) ready with all of this. Judging from the required changes, 2.2.x seems to be the right target. Is that what you had in mind @wilkinsona ?

@bclozel bclozel self-assigned this May 10, 2019
@wilkinsona
Copy link
Member Author

wilkinsona commented May 11, 2019

Thanks, @bclozel. Yeah, given the extent of the changes, 2.2.x sounds right to me. It might be tricky to do it in a non-breaking manner, but I don't think we should wait for 3.0.

@Vidz51
Copy link

Vidz51 commented Sep 14, 2021

I upgraded my spring boot version to 2.5, Now I cant set timezone in application.properties.
This key is removed.
server.jetty.accesslog.time-zone=IST

What is the way of setting the time zone through application.properties in my application?

@wilkinsona
Copy link
Member Author

wilkinsona commented Sep 14, 2021

CustomRequestLog doesn't have a setter for the timezone. I believe Jetty now allows it to be configured via the %t setting in its format. You can set the format using the new server.jetty.accesslog.custom-format. If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

No branches or pull requests

4 participants