Comments (5)
We use logstash-logback-encoder (specifically AccessEventCompositeJsonEncoder
) together with this project and it works great.
from logback-access-spring-boot-starter.
I think that formatting the output is the work of Logback's Appenders/Encoders/Layouts.
So, I do not have plans to support it.
Please combine another libraries or your own implementation.
Logback's Appender can be set in "logback-access.xml".
For example:
<configuration>
<appender name="JSON" class="com.example.YourJsonFormatAppender">
...
</appender>
<appender-ref ref="JSON" />
</configuration>
from logback-access-spring-boot-starter.
Hi @abatkin! Could you please attach access config here (with AccessEventCompositeJsonEncoder), that works for you?
from logback-access-spring-boot-starter.
@xrom888 I couldn't get AccessEventCompositeJsonEncoder to work
but this logs in json
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashAccessEncoder" />
</appender>
<appender-ref ref="CONSOLE" />
</configuration>
Log example
{"@timestamp":"2020-09-08T14:38:08.455+01:00","@version":"1","message":"0:0:0:0:0:0:0:1 - org.springframework.security.oauth2.jwt.Jwt@be89024 [2020-09-08T14:38:08.455+01:00] \"POST /evaluate/merchant/12346/ HTTP/1.1\" 500 11844","method":"POST","protocol":"HTTP/1.1","status_code":500,"requested_url":"POST /evaluate/merchant/12346/ HTTP/1.1","requested_uri":"/evaluate/merchant/12346/","remote_host":"0:0:0:0:0:0:0:1","remote_user":"org.springframework.security.oauth2.jwt.Jwt@be89024","content_length":11844,"elapsed_time":281}```
from logback-access-spring-boot-starter.
This issue is inactive, so I close it.
If you still have problems, please open a new issue.
from logback-access-spring-boot-starter.
Related Issues (20)
- java.lang.NoSuchMethodError: 'java.util.SortedMap kotlin.collections.MapsKt.sortedMapOf(java.util.Comparator, kotlin.Pair[])' HOT 6
- config file not loading when configured in application.properties HOT 4
- Micrometer Tracing Support for Access Logs HOT 6
- support slf4j (log4j2) HOT 3
- java.lang.NoSuchMethodError: 'java.util.SortedMap kotlin.collections.MapsKt.sortedMapOf(java.util.Comparator, kotlin.Pair[])' HOT 4
- Invalid characters in HTTP requests can cause NullPointerException in the access logs HOT 2
- Support Spring Boot 3 HOT 9
- The request body is being printed out only if the content type is set to application/x-www-form-urlencoded. Not otherwise.
- Hashing remote user HOT 1
- JSON Access log Logging HOT 2
- Jetty 12 Compatibility (Spring Boot 3.2.x) HOT 2
- support async appenders
- Support logback-access v2.0.0
- maybe make `spring-boot-starter-web` optional dependency HOT 2
- spring boot 2.2.2.RELEASE not work HOT 5
- Actuator on different port not logging HOT 2
- Add support for Undertow reactive web server
- Starter does not configure Tomcat when a servletContainer bean is configured
- Spring Boot Embedded Tomcat NullPointerException get-serverName HOT 3
- Options for working around LOGBACK-1526 in 3.x version of this lib HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logback-access-spring-boot-starter.