Skip to content

Migrate from NCSARequestLog to CustomRequestLog #16416

Closed
@wilkinsona

Description

@wilkinsona
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.

Activity

added this to the 2.2.x milestone on Apr 2, 2019
umeshrawat

umeshrawat commented on Apr 2, 2019

@umeshrawat

@wilkinsona Can I take this up?

wilkinsona

wilkinsona commented on Apr 3, 2019

@wilkinsona
MemberAuthor

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

bclozel commented on May 10, 2019

@bclozel
Member

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 ?

self-assigned this
on May 10, 2019
wilkinsona

wilkinsona commented on May 11, 2019

@wilkinsona
MemberAuthor

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.

modified the milestones: 2.2.x, 2.2.0.M3 on May 13, 2019
Vidz51

Vidz51 commented on Sep 14, 2021

@Vidz51

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

wilkinsona commented on Sep 14, 2021

@wilkinsona
MemberAuthor

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @bclozel@wilkinsona@umeshrawat@Vidz51

      Issue actions

        Migrate from NCSARequestLog to CustomRequestLog · Issue #16416 · spring-projects/spring-boot