[logback-user] Fwd: logback issue

Yaer Dili yedili at thoughtworks.com
Sun Nov 3 06:45:12 CET 2019


---------- Forwarded message ---------
From: Yaer Dili <yedili at thoughtworks.com>
Date: Sat, Nov 2, 2019 at 6:22 PM
Subject: Re: [logback-user] logback issue
To: Ceki <ceki at qos.ch>


thank you for your reply Ceki, we also believe that logback design in this
way, but in our case logback stop our application from successfully launch,
I added some details in the following section and you may be able to
reproduce this issue

we configure all the logback configurations in the `logback-spring.xml`
file like this

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/logging/logback/defaults.xml"/>

    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>
                %d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread])
%highlight(%-5level) %logger %M %line - [traceID: %X{X-B3-TraceId}] -
[RequestId: %X{RequestId}] - [ClientId: %X{ClientId}] - %message
%exception{full} %n
            </pattern>
        </encoder>
    </appender>
    <springProfile name="local,dev">
        <root level="DEBUG">
            <appender-ref ref="console"/>
        </root>
    </springProfile>


as you can see from the above code snippet we create an appender and attach
this to local, dev spring profile. after this, we try to create a new
spring profile called dev2 and activate this profile by the following
configuration in `application.yml` file

profiles:
  active: dev2


so we have three environment property file in our project
[image: image.png]


after we try to start our application, it failed to start without any error
message, we only can see the following message no other output
[image: image.png]


and as I said in the previous email we can fix this by adding the `dev2`
env profile name to the  logback configuration file like this

<springProfile name="local,dev,dev2">

at this point, we are not sure whether we encounter this issue, is it
because of our configuration or is it an existing issue of logback?

Regards,
yaer

On Sat, Nov 2, 2019 at 12:07 PM Ceki <ceki at qos.ch> wrote:

> Hi Yaer,
>
> Logback is designed to isolate the application from any errors that it
> (logback) might encounter. I very much doubt that logback would prevent
> an application from starting. Do you have any further details to provide?
>
> Best,
> --
> Ceki Gülcü
>
> On 02.11.2019 04:46, Yaer Dili wrote:
> > hi there,
> > we are using logback in our spring boot application and all our logback
> > related configuration is in the `logback-spring.xml` file ad we
> > configure  `springProfile` for different environments in the xml file
> > like this
> >
> > <springProfile name="local,dev">
> > <root level="DEBUG">
> > <appender-ref ref="console"/>
> > </root>
> > </springProfile>
> >
> > after this configuration if we want to add other environment property,
> > it must be added to this `springProfile` first otherwise our application
> > failed to start with newly added property file.
> >
> > for example if I just add a new property file called
> > `application-uat.yml` and directly start the application with this
> > property file, our application failed to start. for fixing this I need
> > to add this property name in the `SpringProfile` configuration like this
> > `<springProfile name="local,dev,uat">`
> >
> > we think logback rather than directly block our app start should have a
> > default value for newly added property file, do you have anything to
> > share with us? thank you
> >
> > regards,
> > yaer
> >
> > _______________________________________________
> > logback-user mailing list
> > logback-user at qos.ch
> > http://mailman.qos.ch/mailman/listinfo/logback-user
> >
>
> --
> --
> Ceki Gülcü
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20191103/db394f41/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 39220 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20191103/db394f41/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 24624 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20191103/db394f41/attachment-0003.png>


More information about the logback-user mailing list