How to redirect the log message to a file?


(Miracle24) #1

I use ES2.1.0.0 and I have a script. when I run the scrip,it will show the log message,like
[2015-12-13 14:21:35,986][INFO ][index.shard ] [Dagger] [world][2] updating refresh_interval from [16.6m] to [-1000] [2015-12-13 14:21:35,987][INFO ][index.shard ] [Dagger] [world][3] updating refresh_interval from [16.6m] to [-1000] [2015-12-13 14:21:35,987][INFO ][index.shard ] [Dagger] [world][1] updating refresh_interval from [16.6m] to [-1000] [2015-12-13 14:21:35,987][INFO ][index.shard ] [Dagger] [world][0] updating refresh_interval from [16.6m] to [-1000] [2015-12-13 14:21:35,987][INFO ][index.shard ] [Dagger] [world][4] updating refresh_interval from [16.6m] to [-1000]
And when I run the script in the background, and even when I redirect the message to some file, using command like
./test.sh > test.log 2>1&,
it happened, too. That makes me feel upset and confused. How can I solve this?


(David Pilato) #2

May be -d ?

https://www.elastic.co/guide/en/elasticsearch/reference/current/setup.html#setup-installation-daemon


(system) #3