Git Product home page Git Product logo

Comments (5)

abatkin avatar abatkin commented on June 1, 2024 4

We use logstash-logback-encoder (specifically AccessEventCompositeJsonEncoder) together with this project and it works great.

from logback-access-spring-boot-starter.

akkinoc avatar akkinoc commented on June 1, 2024

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.

xrom888 avatar xrom888 commented on June 1, 2024

Hi @abatkin! Could you please attach access config here (with AccessEventCompositeJsonEncoder), that works for you?

from logback-access-spring-boot-starter.

Athas1980 avatar Athas1980 commented on June 1, 2024

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

akkinoc avatar akkinoc commented on June 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.