question

vikaskatru-8230 avatar image
0 Votes"
vikaskatru-8230 asked TomazinKennethG-3469 commented

Can I integrate Log Analytics with log4j2?

Use-case: Running Spark job in Databricks and monitoring logs in LogAnalytics.

Issue: In Veracode report, I am getting security vulnerabilities(CRLF) with Slf4j logger.

I am looking for other approaches, with Log4j2 I don't see any issues.

Now my question is, I want to integrate LogAnalytics with Log4j2, is that possible in my case?

azure-monitorazure-databricks
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@vikaskatru-8230 Thank you for reaching out

  • You should be able to send log data to Azure Monitor with the HTTP Data Collector API. Came across this GitHub private repo which uses HTTP Data Collector API to send Log4j logs to Azure Log Analytics , please see if that helps.

  • Regarding Monitoring Azure Databricks in an Azure Log Analytics Workspace , please see if the solution in this repo helps.

Hope the above information helps. Please review the information and circle back if you have any further queries. Thank you

0 Votes 0 ·

Thanks @bharathn-msft , I tried the same approach you mentioned for Monitoring Azure Databricks in an Azure Log Analytics.

The problem is they are using Log4j 1.x in spark-listeners-loganalytics, and I am facing some security issues in Veracode report because of Log4j 1.x.

So is there any way I can use Log4j 2.x in the same approach? like creating log-analytics.properties file that supports log4j 2.x and use log4j 2.x in spark-listeners instead of log4j 1.x

0 Votes 0 ·

@vikaskatru-8230 Thank you for sharing additional information, I am circling back with our internal teams to understand if there is any limitation around using Log4j 2.x. Will keep you updated as I get more information.

0 Votes 0 ·
Show more comments

1 Answer

OlegAnanievMSFT-9645 avatar image
0 Votes"
OlegAnanievMSFT-9645 answered

I am working to locate the relevant owners of the libraries, but for faster response, I would suggest to log a question/issue to the library repo - https://github.com/mspnp/spark-monitoring

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.