Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Additional fields with "comma" #21

Open
trajano opened this issue Dec 20, 2018 · 1 comment
Open

Additional fields with "comma" #21

trajano opened this issue Dec 20, 2018 · 1 comment

Comments

@trajano
Copy link

trajano commented Dec 20, 2018

I would like to pass a list of the active spring profiles via additional fields, but since there's a comma it does not work correctly.

<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true">
  <include resource="org/springframework/boot/logging/logback/base.xml"/>
  <springProperty scope="context" name="name" source="spring.application.name"/>
  <springProperty scope="context" name="profiles" source="spring.profiles.active" defaultValue="default"/>

  <appender name="gelf" class="de.appelgriepsch.logback.GelfAppender">
    <server>192.168.1.113</server>
    <includeSource>true</includeSource>
    <includeMDC>true</includeMDC>
    <includeLevelName>true</includeLevelName>
    <additionalFields>profiles=${profiles},name=${name}</additionalFields>
  </appender>
  <root>
    <appender-ref ref="gelf"/>
  </root>
</configuration>

@trajano
Copy link
Author

trajano commented Dec 20, 2018

Perhaps if we had

<additionalFields>
   <field name="profiles" value="${profiles}" />
</additionalFields>

or

<additionalFields>
   <profiles>${profiles}"</profiles>
</additionalFields>

Maybe even

<additionalFields>
   <profiles processor="CSVProcessor">${profiles}"</profiles>
</additionalFields>

Which will take the value and convert it to an array sent to GELF (If that's even possible)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant