Logs rotate quite fast, particularly, when the log level has been increased to DEBUG or VERBOSE, which makes it sometimes difficult to collect the appropriate data in the log files before they are rotated.
To assure you see or collect the correct log information, you can follow the log files in real-time through the Windows PowerShell, or the Ubuntu or macOS terminal. You can also save the real-time output into a separate file, which afterward can be shared with the Nx Support team.
Instructions for Windows:
To follow a log file in real-time, the Get-Content command is used. First, you need to open PowerShell and navigate to the directory where the log file is located. Once you are in the correct directory, you can use the Get-Content command followed by the name of the log file and the -Wait parameter. The -Wait parameter tells the application to continuously monitor the log file for new content.
For example, if you want to continuously monitor the log file for new content, you would use the command:
Get-Content log_file.log -Wait
If you want to continuously monitor the log file for new content ánd write it to the "<fileName.log>" file, you would use the command:
Get-Content log_file.log -Wait | Out-File <fileName.log>
You can stop the process with Ctrl + C.
Instructions for Ubuntu and macOS:
To follow a log file in real-time, the less command is used. First, you need to open a terminal and navigate to the directory where the log file is located. Once you are in the correct directory, you can use the less command followed by the name of the log file and the -F parameter. The -F parameter tells the application to continuously monitor the log file for new content.
For example, if you want to continuously monitor the log file for new content, you would use the command:
less -F log_file.log
If you want to continuously monitor the log file for new content ánd write it to the "<fileName.log>" file, you would use the command:
less -F log_file.log > logbackup.log
You can stop the process with Ctrl + C.
Questions
If you have any questions related to this topic, or you want to share your experience with other community members or our team, please visit and engage in our support community or reach out to your local reseller.
Comments
0 comments
Article is closed for comments.