Nao-diagnostic is a command-line tool to compile useful files for NAO and PEPPER diagnostic.
This article explains how to generate diagnostic files into a single archived file.
It is saved in the permanent memory of the Robot, in the /home/nao/diagnosis directory.
The structure of the archive depends on the NAOqi version.
It contains a lot of data about the robot state, including log files: