Skip to content

Tutorial Monitor a Java Application - Feedback on some problems encountered #1836

@daverick

Description

@daverick

Hi,

I have followed the Monitor a Java Application tutorial This is a great tutorial!

but I have found some problems along the way and some solutions too. I am not a Java Developper so they might not be the best ones ;-)

  • in the Step 1.10, I need to add a dependencies in the build.gradle to be able to execute the application (openJDK 15)
implementation 'org.slf4j:slf4j-simple:1.7.30
  • in the steps 4, Write logs as JSON I had to change the log4j2 settings to:
<Loggers>
    <Logger name="de.spinscale.javalin.App" level="INFO"/>
    <Root level="ERROR">
      <AppenderRef ref="Console" />
      <AppenderRef ref="JavalinAppLogRolling" />
    </Root>
  </Loggers>
  • on step 7, customer transactions I had to add in App.java
import co.elastic.apm.api.ElasticApm;
  • on step 7, method tracing via agent configuration, the new logger class is not working correctly and generate messages and before the Step 2- Log requests ;-(

And in the Step 4, ingest nodes, step 3 I would rather put the pipeline configuration at the input level instead of the output. It's the same result but imo it is better placed at that level as it should only be used for this log.

filebeat.inputs:
- type: log
  paths:
    - /tmp/javalin/*.log
  multiline.pattern: ^20
  multiline.negate: true
  multiline.match: after
  processors:
  - add_host_metadata: ~
  pipeline: javalin_pipeline

Metadata

Metadata

Assignees

No one assigned

    Labels

    Team:IngestIssues owned by the Ingest Docs TeambugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions