How to set log in kibana?


(minhua) #1

I installed kibana by default in windows 2008 r2 a few months ago.

However, I did not see log folder under the kibana installation folder.

I found that I could set config file as below in kibana.yml.

logging.dest: stdout

Atfer I set the kibana.yml and restarted the kibana service, I still did not find log folder under the kibana folder.

Is there something wrong with me?


(Jen Huang) #2

logging.dest: stdout will not create a log file. You can try a value that is a path, such as logging.dest: /var/log/kibana.log.


(minhua) #3

Thanks.

Could you tell me how to set kibana.yml to generate log files by daily?

For example:
d:/kibana/log/kibana.log.20190112.log
d:/kibana/log/kibana.log.20190113.log
d:/kibana/log/kibana.log.20190114.log


(Jen Huang) #4

That isn't possible via kibana.yml. You could create a bash script that copies the Kibana log file every day at midnight, add the date to the new file name, and clear the original Kibana log file.


#5

While this isn't native to the Elastic stack it is possible with a log rotate script. On Linux you would use logrotate as described here:

In your case on Windows I found this powershell script option on TechNet: https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Script-to-Roll-a96ec7d4

The powershell script doesn't meet exactly the needs you spelled out but could be modified to meet what you're looking for.