Topics Map > Application Hosting > Java/Tomcat
Topics Map > Service Documentation > Secure FTP
Web Hosting - Java/Tomcat - Developer Troubleshooting and Logs
This guide provides Java/Tomcat developers with best practices for logging, troubleshooting, and accessing Apache/Tomcat logs in the Web Hosting environment. Proper logging strategies are essential for diagnosing issues and maintaining application stability.
Best Practices
- Plan your logging strategy during development and deployment and do not rely solely on default logging libraries. Customize logging for your application’s requirements.
-
Log errors and warnings within your application rather than relying on Tomcat logs. Apache HTTP logs only indicate that an error occurred and do not provide application specific details.
-
Server-level logs, such as Catalina output, won’t include your application-specific logs. We are not logging standard input and output into Catalina; this is your responsibility.
Handle Exceptions Properly:
- Prevent uncaught exceptions from escaping your application.
- Implement a top-level try-catch block for comprehensive error handling.
Adjust logging levels and Debugging
- Increase logging levels based on environment e.g. Production logging for severe errors to trace issues not seen in development or testing.
-
Considering adding top level error handling code which can log errors and warnings to your web application logs as a more appropriate location than tomcat log.
Java customers have real-time access to Apache and Tomcat logs through two methods:
1. Plesk Log Viewer
- Log in to the Plesk Control Panel for your domain.
- Open Logs icon from the dashboard
- View real-time logs and archives for:
- Apache Access Logs
- Apache Error Logs
-
A Custom log file can be added from your website directory to the log viewer. In the log manager select Manage Log Files --> Add Custom Log --> Select the file and click OK.
-
For example, navigate to tomcat/logs -> select something like catalina.out, manager.<date>.log, <appname>.log, localhost.<date>.log or localhost_access_log.<date>.txt
- View real-time logs and archives for:
2. Secure FTP and SSH
- Connect using your provided hostname, username, and password.
- Navigate to the
/logsfolder. - Open the
/tomcatfolder.
3. Plesk File Manager
- Log in to the Plesk Control Panel for your domain.
- Open File Manager icon from the dashboard
- Navigate to the
/logsfolder. - Open the
/tomcatfolder.
- Apache WebServer (read-only) Configuration Availability
- Restarting Tomcat Server
- Access to Tomcat Manager
- Tomcat Documentation
