HANA log and trace files path

Requirement : You want to access HANA  error logs and trace files.
Prerequisite : You need <SID>adm credentials to check logs at OS level and you need TRACE ADMIN or DATA ADMIN to view or delete log files in HANA Studio.

Solution :
At OS level these diagnosis files(trace and log files) are generated at following location of each node/hostname.

For System DB : 
/usr/sap/<SID>/HDB<nn>/<hostname>/trace  Or $DIR_INSTANCE/<hostname>/trace
You can also execute shell command alias cdtrace to access these files.

Starting HANA 2.0 , the trace file of HANA SID(tenant) has its own folder within the main trace folder.

For HANA SID , tenant:
/usr/sap/<SID>/HDB<nn>/<hostname>/trace/DB_<SID>  Or $DIR_INSTANCE/<hostname>/trace/DB_<SID>

DB_<SID> is the logs folder for tenant logs. 

HANA log files at OS level

As you can see  the trace files are stored separated per host,so to get access to the trace files of a multi-node system you have to check for each host individually.

One can get all trace file location info by executing following SQL in HANA :


The best way to analyze these files is using HANA Studio - Administrative perspective - Diagnosis Files page tab.
HANA Studio diagnosis files
This provides us an option to Merge Diagnosis Files - This feature is very helpful during troubleshooting as we can review multiple diagnosis files in one go.

Reference http://help.sap.com

Related :
How to configure HANA log/trace file rotation?
Trace/log files rotation prevents log files from growing indefinitely by limiting the number and size of files.We can configure the log file rotation specific to one service or for the all services together.