Skip to content

Commit

Permalink
Merge pull request #107 from grida-diary/main
Browse files Browse the repository at this point in the history
Prod
  • Loading branch information
wwan13 authored Aug 16, 2024
2 parents 17388fa + a6f898d commit 2f072a6
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 128 deletions.
3 changes: 3 additions & 0 deletions grida-core/core-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ dependencies {
// security
implementation("com.github.wwan13:winter-security:0.0.10")

// logging-request
implementation("com.github.wwan13:spring-request-logger:0.0.3")

// api docs
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc")
testImplementation("com.github.wwan13.kotlin-dsl-rest-docs:impl-mockmvc:1.2.9")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
package org.grida.config

import org.grida.support.requestlogger.EnableLogRequest
import io.wwan13.springrequestlogger.configure.EnableLoggingRequest
import io.wwan13.springrequestlogger.configure.LogMessageConfigurer
import io.wwan13.springrequestlogger.context.RequestContext
import org.springframework.boot.context.properties.ConfigurationPropertiesScan
import org.springframework.context.annotation.Configuration
import java.util.function.Function

@Configuration
@ConfigurationPropertiesScan
@EnableLogRequest
class CoreApiConfig
@EnableLoggingRequest
class CoreApiConfig : LogMessageConfigurer {

override fun format(): Function<RequestContext, String> {
return Function { context ->
"""
|
| ${context.method} '${context.uri}' - ${context.status} (${context.elapsed} s)
| >> Request Headers : ${context.requestHeaders}
| >> Request Params : ${context.requestParams}
| >> Request Body : ${context.requestBody}
| >> Response Body : ${context.responseBody}
""".trimMargin()
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 2f072a6

Please sign in to comment.