Solr to Application Insights
How can I configure Solr logs to get sent to Azure Application Insights?
I see can use a Log4J appender.
https://docs.microsoft.com/en-us/azure/application-insights/app-insights-java-trace-logs
Solr is an open source project, and I don't compile it myself, I just use the distribution.
How can I drop in Application Insights/Log4J appender, without recompiling having installed the SDK?
I just want to configure the logs to get sent to application insghts, for effectively a 3rd party application.
And configure the instrumentation key.
I'm normally a C# dev, but familiar with Log4Net. So appologies if this is simple in Java Log4J. Not been able to find a post for this scenario so posting here.
Using Solr 6.6.
solr log4j azure-application-insights
add a comment |
How can I configure Solr logs to get sent to Azure Application Insights?
I see can use a Log4J appender.
https://docs.microsoft.com/en-us/azure/application-insights/app-insights-java-trace-logs
Solr is an open source project, and I don't compile it myself, I just use the distribution.
How can I drop in Application Insights/Log4J appender, without recompiling having installed the SDK?
I just want to configure the logs to get sent to application insghts, for effectively a 3rd party application.
And configure the instrumentation key.
I'm normally a C# dev, but familiar with Log4Net. So appologies if this is simple in Java Log4J. Not been able to find a post for this scenario so posting here.
Using Solr 6.6.
solr log4j azure-application-insights
1
Have you seen Configuring Logging in the Solr reference guide? It's using log4j2, and you can add any .jars in the lib directories defined in your solr configuration file.
– MatsLindh
Nov 22 '18 at 22:28
Thanks, yes I read that page, but didn't see anything on referencing other jars? I presume possible, but can't see a detailed guide.
– Ian
Nov 22 '18 at 22:36
1
See Lib directives in solrconfig for how to give specific paths to load jars from
– MatsLindh
Nov 23 '18 at 7:22
thanks, that link was broken but found the page - lucene.apache.org/solr/guide/6_6/…
– Ian
Nov 23 '18 at 9:44
add a comment |
How can I configure Solr logs to get sent to Azure Application Insights?
I see can use a Log4J appender.
https://docs.microsoft.com/en-us/azure/application-insights/app-insights-java-trace-logs
Solr is an open source project, and I don't compile it myself, I just use the distribution.
How can I drop in Application Insights/Log4J appender, without recompiling having installed the SDK?
I just want to configure the logs to get sent to application insghts, for effectively a 3rd party application.
And configure the instrumentation key.
I'm normally a C# dev, but familiar with Log4Net. So appologies if this is simple in Java Log4J. Not been able to find a post for this scenario so posting here.
Using Solr 6.6.
solr log4j azure-application-insights
How can I configure Solr logs to get sent to Azure Application Insights?
I see can use a Log4J appender.
https://docs.microsoft.com/en-us/azure/application-insights/app-insights-java-trace-logs
Solr is an open source project, and I don't compile it myself, I just use the distribution.
How can I drop in Application Insights/Log4J appender, without recompiling having installed the SDK?
I just want to configure the logs to get sent to application insghts, for effectively a 3rd party application.
And configure the instrumentation key.
I'm normally a C# dev, but familiar with Log4Net. So appologies if this is simple in Java Log4J. Not been able to find a post for this scenario so posting here.
Using Solr 6.6.
solr log4j azure-application-insights
solr log4j azure-application-insights
asked Nov 22 '18 at 22:17
IanIan
961820
961820
1
Have you seen Configuring Logging in the Solr reference guide? It's using log4j2, and you can add any .jars in the lib directories defined in your solr configuration file.
– MatsLindh
Nov 22 '18 at 22:28
Thanks, yes I read that page, but didn't see anything on referencing other jars? I presume possible, but can't see a detailed guide.
– Ian
Nov 22 '18 at 22:36
1
See Lib directives in solrconfig for how to give specific paths to load jars from
– MatsLindh
Nov 23 '18 at 7:22
thanks, that link was broken but found the page - lucene.apache.org/solr/guide/6_6/…
– Ian
Nov 23 '18 at 9:44
add a comment |
1
Have you seen Configuring Logging in the Solr reference guide? It's using log4j2, and you can add any .jars in the lib directories defined in your solr configuration file.
– MatsLindh
Nov 22 '18 at 22:28
Thanks, yes I read that page, but didn't see anything on referencing other jars? I presume possible, but can't see a detailed guide.
– Ian
Nov 22 '18 at 22:36
1
See Lib directives in solrconfig for how to give specific paths to load jars from
– MatsLindh
Nov 23 '18 at 7:22
thanks, that link was broken but found the page - lucene.apache.org/solr/guide/6_6/…
– Ian
Nov 23 '18 at 9:44
1
1
Have you seen Configuring Logging in the Solr reference guide? It's using log4j2, and you can add any .jars in the lib directories defined in your solr configuration file.
– MatsLindh
Nov 22 '18 at 22:28
Have you seen Configuring Logging in the Solr reference guide? It's using log4j2, and you can add any .jars in the lib directories defined in your solr configuration file.
– MatsLindh
Nov 22 '18 at 22:28
Thanks, yes I read that page, but didn't see anything on referencing other jars? I presume possible, but can't see a detailed guide.
– Ian
Nov 22 '18 at 22:36
Thanks, yes I read that page, but didn't see anything on referencing other jars? I presume possible, but can't see a detailed guide.
– Ian
Nov 22 '18 at 22:36
1
1
See Lib directives in solrconfig for how to give specific paths to load jars from
– MatsLindh
Nov 23 '18 at 7:22
See Lib directives in solrconfig for how to give specific paths to load jars from
– MatsLindh
Nov 23 '18 at 7:22
thanks, that link was broken but found the page - lucene.apache.org/solr/guide/6_6/…
– Ian
Nov 23 '18 at 9:44
thanks, that link was broken but found the page - lucene.apache.org/solr/guide/6_6/…
– Ian
Nov 23 '18 at 9:44
add a comment |
1 Answer
1
active
oldest
votes
It takes a lot less configuration than you'd expect, and most of the info is hidden away in the link that you've already got: https://docs.microsoft.com/en-gb/azure/azure-monitor/app/java-trace-logs
First, go download the jar files from https://github.com/Microsoft/ApplicationInsights-Java/releases. You'll want applicationinsights-logging-log4j1_2-2.3.0
and applicationinsights-core-2.3.0
. Put these in the server/lib folder and Solr will load them automatically for you.
Next you''ll need to add a new appender for app insights into your log4j.properties file
# Appinsights
log4j.appender.aiAppender=com.microsoft.applicationinsights.log4j.v1_2.ApplicationInsightsAppender
log4j.appender.aiAppender.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.aiAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%n
You also need to add this aiAppender
to the log4j.rootLogger
list in the same file (it'll probably look something like this: log4j.rootLogger=INFO, file, CONSOLE, aiAppender
)
Finally, you need an ApplicationInsights.xml file, which you can get an example of from here https://docs.microsoft.com/en-gb/azure/azure-monitor/app/java-get-started#2-add-the-application-insights-sdk-for-java-to-your-project
Drop this in the server/resources folder, set your instrumentation key and you're good to go!
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53438572%2fsolr-to-application-insights%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It takes a lot less configuration than you'd expect, and most of the info is hidden away in the link that you've already got: https://docs.microsoft.com/en-gb/azure/azure-monitor/app/java-trace-logs
First, go download the jar files from https://github.com/Microsoft/ApplicationInsights-Java/releases. You'll want applicationinsights-logging-log4j1_2-2.3.0
and applicationinsights-core-2.3.0
. Put these in the server/lib folder and Solr will load them automatically for you.
Next you''ll need to add a new appender for app insights into your log4j.properties file
# Appinsights
log4j.appender.aiAppender=com.microsoft.applicationinsights.log4j.v1_2.ApplicationInsightsAppender
log4j.appender.aiAppender.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.aiAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%n
You also need to add this aiAppender
to the log4j.rootLogger
list in the same file (it'll probably look something like this: log4j.rootLogger=INFO, file, CONSOLE, aiAppender
)
Finally, you need an ApplicationInsights.xml file, which you can get an example of from here https://docs.microsoft.com/en-gb/azure/azure-monitor/app/java-get-started#2-add-the-application-insights-sdk-for-java-to-your-project
Drop this in the server/resources folder, set your instrumentation key and you're good to go!
add a comment |
It takes a lot less configuration than you'd expect, and most of the info is hidden away in the link that you've already got: https://docs.microsoft.com/en-gb/azure/azure-monitor/app/java-trace-logs
First, go download the jar files from https://github.com/Microsoft/ApplicationInsights-Java/releases. You'll want applicationinsights-logging-log4j1_2-2.3.0
and applicationinsights-core-2.3.0
. Put these in the server/lib folder and Solr will load them automatically for you.
Next you''ll need to add a new appender for app insights into your log4j.properties file
# Appinsights
log4j.appender.aiAppender=com.microsoft.applicationinsights.log4j.v1_2.ApplicationInsightsAppender
log4j.appender.aiAppender.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.aiAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%n
You also need to add this aiAppender
to the log4j.rootLogger
list in the same file (it'll probably look something like this: log4j.rootLogger=INFO, file, CONSOLE, aiAppender
)
Finally, you need an ApplicationInsights.xml file, which you can get an example of from here https://docs.microsoft.com/en-gb/azure/azure-monitor/app/java-get-started#2-add-the-application-insights-sdk-for-java-to-your-project
Drop this in the server/resources folder, set your instrumentation key and you're good to go!
add a comment |
It takes a lot less configuration than you'd expect, and most of the info is hidden away in the link that you've already got: https://docs.microsoft.com/en-gb/azure/azure-monitor/app/java-trace-logs
First, go download the jar files from https://github.com/Microsoft/ApplicationInsights-Java/releases. You'll want applicationinsights-logging-log4j1_2-2.3.0
and applicationinsights-core-2.3.0
. Put these in the server/lib folder and Solr will load them automatically for you.
Next you''ll need to add a new appender for app insights into your log4j.properties file
# Appinsights
log4j.appender.aiAppender=com.microsoft.applicationinsights.log4j.v1_2.ApplicationInsightsAppender
log4j.appender.aiAppender.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.aiAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%n
You also need to add this aiAppender
to the log4j.rootLogger
list in the same file (it'll probably look something like this: log4j.rootLogger=INFO, file, CONSOLE, aiAppender
)
Finally, you need an ApplicationInsights.xml file, which you can get an example of from here https://docs.microsoft.com/en-gb/azure/azure-monitor/app/java-get-started#2-add-the-application-insights-sdk-for-java-to-your-project
Drop this in the server/resources folder, set your instrumentation key and you're good to go!
It takes a lot less configuration than you'd expect, and most of the info is hidden away in the link that you've already got: https://docs.microsoft.com/en-gb/azure/azure-monitor/app/java-trace-logs
First, go download the jar files from https://github.com/Microsoft/ApplicationInsights-Java/releases. You'll want applicationinsights-logging-log4j1_2-2.3.0
and applicationinsights-core-2.3.0
. Put these in the server/lib folder and Solr will load them automatically for you.
Next you''ll need to add a new appender for app insights into your log4j.properties file
# Appinsights
log4j.appender.aiAppender=com.microsoft.applicationinsights.log4j.v1_2.ApplicationInsightsAppender
log4j.appender.aiAppender.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.aiAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%n
You also need to add this aiAppender
to the log4j.rootLogger
list in the same file (it'll probably look something like this: log4j.rootLogger=INFO, file, CONSOLE, aiAppender
)
Finally, you need an ApplicationInsights.xml file, which you can get an example of from here https://docs.microsoft.com/en-gb/azure/azure-monitor/app/java-get-started#2-add-the-application-insights-sdk-for-java-to-your-project
Drop this in the server/resources folder, set your instrumentation key and you're good to go!
answered Feb 1 at 15:47
StuartStuart
362
362
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53438572%2fsolr-to-application-insights%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Have you seen Configuring Logging in the Solr reference guide? It's using log4j2, and you can add any .jars in the lib directories defined in your solr configuration file.
– MatsLindh
Nov 22 '18 at 22:28
Thanks, yes I read that page, but didn't see anything on referencing other jars? I presume possible, but can't see a detailed guide.
– Ian
Nov 22 '18 at 22:36
1
See Lib directives in solrconfig for how to give specific paths to load jars from
– MatsLindh
Nov 23 '18 at 7:22
thanks, that link was broken but found the page - lucene.apache.org/solr/guide/6_6/…
– Ian
Nov 23 '18 at 9:44