Generating unique log files when running SnowSQL

前提是你 提交于 2020-01-25 10:21:09

问题


(submitting on behalf of a Snowflake User)


I understand that you can configure log files by following this documentation (https://docs.snowflake.net/manuals/user-guide/snowsql-config.html#configuration-options-section) and the following snippet:

| log_bootstrap_file | ~/.snowsql/log_... | SnowSQL bootstrap log file location |

| log_file | ~/.snowsql/log | SnowSQL main log file location

BUT(!) is there a way to save log file of different jobs under different paths?


Any recommendations would be greatly appreciated! THANKS!


回答1:


I would do something like the following, where I add the log file location to the snowsql command and my config file has a config called configName.

snowsql -c configName -o log_file=~/.snowsql/"$(date +'%Y%m%d_%H%M%S')"log

This example uses a pretty-close-to-unique-name for the logfile name, assuming you don't have two processes starting at the same second, this should work. If you need to modify the path (e.g. /tmp/log/uniqueName/logfile.log), you could use OS environment variables in the same fashion, note however you'd likely have to create that folder/directory first.

I hope this helps...Rich



来源:https://stackoverflow.com/questions/58348480/generating-unique-log-files-when-running-snowsql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!