Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to include inner json object #71

Open
vladigeras opened this issue Apr 22, 2020 · 0 comments
Open

How to include inner json object #71

vladigeras opened this issue Apr 22, 2020 · 0 comments

Comments

@vladigeras
Copy link

vladigeras commented Apr 22, 2020

Thank you for project!

I would like to send logs by next structure:

{
  "event": {
    "severity": "INFO",
    "message": {
      "correlationId": "9df8d06b7d3f0c42bf2d81fbc976a6c1",
      "system": "WebApi"
    }
  }
}

And I send logs like this:

<appender name="ELASTIC" class="com.internetitem.logback.elasticsearch.ElasticsearchAppender">
  <url>http://localhost:9200/_bulk</url>
  <index>logs</index>
  <properties>
     <property>
          <name>event</name>
          <value>
              <property>
                  <name>severity</name>
                  <value>%level</value>
              </property>
              <property>
                  <name>message</name>
                  <value>
                      <property>
                          <name>correlationId</name>
                          <value>correlationId</value>
                       </property>
                       <property>
                          <name>system</name>
                          <value>system</value>
                       </property>
                  </value>
              </property>
          </value>
      </property>
  </properties>
  <headers>
    <header>
        <name>Content-Type</name>
	<value>application/json</value>
    </header>
  </headers>
</appender>

I get the next error

ERROR in ch.qos.logback.core.joran.spi.Interpreter@45:18 - no applicable action for [property], current ElementPath  is [[configuration][appender][properties][property][value][property][value][property]]

I think, this is incorrect approach. How can I do it?

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

No branches or pull requests

1 participant