# Get errors from logs

**URL:** <https://discuss.elastic.co/t/get-errors-from-logs/10260>\
**Category:** Elasticsearch\
**Created:** [January 8, 2013, 10:25am UTC](https://discuss.elastic.co/t/get-errors-from-logs/10260 "2013-01-08T10:25:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrea\_crotti](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@andrea\_crotti](https://discuss.elastic.co/u/andrea_crotti)\
**Post date:** [January 8, 2013, 10:25am UTC](https://discuss.elastic.co/t/get-errors-from-logs/10260/1 "2013-01-08T10:25:46Z")

</div>

We are using elasticsearch together with couchdb, and they run on different  
servers.

Everything works fine but the problem is that we don't have a clue when  
something goes wrong, because the errors from the logs are not  
automatically parsed and feed into sentry (which we use for centralising  
the logs). The problem is that elasticsearch.log contains everything  
together, and the documentation about how to configure the logging is a bit  
lacking imho...

How would I for example log on a separate files all the errors for example?  
All we need is a way to parse possible errors from files somehow and log  
them into sentry as well, any suggestions?

Thanks a lot,  
Andrea

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [January 8, 2013, 3:48pm UTC](https://discuss.elastic.co/t/get-errors-from-logs/10260/2 "2013-01-08T15:48:50Z")

</div>

If you are familiar with log4j (  
[Apache log4j 1.2 - Short introduction to log4j](http://logging.apache.org/log4j/1.2/manual.html)) configuring elasticsearch  
logs should be easy because by default elasticsearch is using log4j. The  
logging.yml file is basically standard log4j.properties file only  
translated from .properties format into YAML format with all log4j.  
prefixes omitted. Basically something like

rootLogger: INFO, console, file  
logger:

# log action execution errors for easier debugging

action: DEBUG  
.....

in standard log4j.properties file would look like

log4j.rootLogger=INFO, console, file  
log4j.logger.action=DEBUG  
.....

For example, to log errors and warnings into a separate file, you can  
simply create a new file appender file\_warn with threshold set to WARN and  
add it to the rootLogger:

rootLogger: INFO, console, file\*, file\_warn\*  
....  
appender:  
....  
\*  
file\_warn:  
type: dailyRollingFile  
file: ${path.logs}/${cluster.name}-warn.log  
threshold: WARN  
datePattern: "'.'yyyy-MM-dd"  
layout:  
type: pattern  
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"  
\*  
....

On Tuesday, January 8, 2013 5:25:46 AM UTC-5, andrea crotti wrote:

> We are using elasticsearch together with couchdb, and they run on  
> different servers.
> 
> Everything works fine but the problem is that we don't have a clue when  
> something goes wrong, because the errors from the logs are not  
> automatically parsed and feed into sentry (which we use for centralising  
> the logs). The problem is that elasticsearch.log contains everything  
> together, and the documentation about how to configure the logging is a bit  
> lacking imho...
> 
> How would I for example log on a separate files all the errors for  
> example? All we need is a way to parse possible errors from files somehow  
> and log them into sentry as well, any suggestions?
> 
> Thanks a lot,  
> Andrea

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:57am UTC](https://discuss.elastic.co/t/get-errors-from-logs/10260/3 "2017-07-06T02:57:23Z")

</div>


