I testing javaAgent and I trying to log "context.request.body" in APM.
Withe these configuration :
elastic.apm.capture_body=transactions
or
elastic.apm.capture_body=all
The context.request.body is alway set to [REDACTED]
Which type of body do you want to record? Currently, only application/x-www-form-urlencoded (form parameters) are collected. Technically, for GET requests, form parameters are not transmitted in the body, but rather as query parameters. That's why you won't see them in context.request.body but in context.request.url.full.
Could you enable debug logging to verify that the configuration option was actually read? When starting the application, you can then see what the current configuration is. Example:
2018-07-20 10:47:09.759 [main] INFO co.elastic.apm.configuration.StartupInfo - Starting Elastic APM 0.7.0-SNAPSHOT on Java 1.8.0_162 (Oracle Corporation) Mac OS X 10.13.6
2018-07-20 10:47:09.761 [main] DEBUG co.elastic.apm.configuration.StartupInfo - service_name: 'spring-petclinic' (source: Java System Properties)
2018-07-20 10:47:09.761 [main] DEBUG co.elastic.apm.configuration.StartupInfo - logging.log_level: 'DEBUG' (source: Java System Properties)
2018-07-20 10:47:09.761 [main] DEBUG co.elastic.apm.configuration.StartupInfo - capture_body: 'TRANSACTIONS' (source: Java System Properties)
With this configuration, capturing the body of a post form works for me:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.