When reviewing the logs generated by elasticsearch (1.4.x), a single log
message is being split across multiple lines?
Is this configurable within logging.yml? My undstanding is that
elasticsearch is powered by log4j however, I'm not familiar with this
product, nor can I find any decent documentation on the logging.yml file.
On Friday, January 2, 2015 12:20:32 PM UTC-6, Jesse Redl wrote:
Hey All,
When reviewing the logs generated by elasticsearch (1.4.x), a single log
message is being split across multiple lines?
Is this configurable within logging.yml? My undstanding is that
elasticsearch is powered by log4j however, I'm not familiar with this
product, nor can I find any decent documentation on the logging.yml file.
Logging.yml is a funky wrapper around log4j.properties style log4j
configuration so that is why you don't see as much documentation on it.
Do you see log lines smashed together and cut apart randomly? That'd be a
bug.
Its customary for logs to be single lines except for stack traces which
contain multiple lines but all after the first start indented.
Elasticsearch inserts line breaks when it logs large things like thr
cluster state to make scanning the logs visually easier.
You could play with logging.yml to reformat the logs (probably possible to
make them json or something) or you could assume new log events start when
the first part of the new line is the date stamp.
When reviewing the logs generated by elasticsearch (1.4.x), a single log
message is being split across multiple lines?
Is this configurable within logging.yml? My undstanding is that
elasticsearch is powered by log4j however, I'm not familiar with this
product, nor can I find any decent documentation on the logging.yml file.
On Friday, January 02, 2015 at 19:20 CET,
Jesse Redl jredl@vendasta.com wrote:
When reviewing the logs generated by elasticsearch (1.4.x), a single
log message is being split across multiple lines?
Yes, that's normal for Java logs.
Is this configurable within logging.yml? My undstanding is that
elasticsearch is powered by log4j however, I'm not familiar with
this product, nor can I find any decent documentation on the
logging.yml file.
I suspect the reason you're asking is that you're considering
ingesting the Elasticsearch logs with Logstash, in which case
you should look into the JSONEventLayoutV1 Log4j layout
(https://github.com/logstash/log4j-jsonevent-layout) to get the
logs in JSON format. You should be able to drop that jar file
along with its dependencies (net.minidev:json-smart:1.1.1 and
commons-lang:commons-lang:2.6) into the Elasticsearch lib directory
(typically /usr/share/elasticsearch/lib) and adjust logging.yml
to use that layout. See also https://github.com/elasticsearch/elasticsearch/issues/8786.
--
Magnus Bäck | Software Engineer, Development Tools magnus.back@sonymobile.com | Sony Mobile Communications
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.