When an application fails to deploy to a server, you can troubleshoot the issue by checking the server logs. Cloud Toolkit provides a built-in Terminal that lets you quickly view real-time log information when you deploy a local application to a server. This topic describes how to view real-time logs by deploying an application to a Linux server in IntelliJ IDEA.
Prerequisites
- You have added a server in IntelliJ IDEA. For more information, see Add a remote server.
- To upload files to a Windows system, ensure that OpenSSH is configured. For more information, see Preparations.
Procedure
- Open your project in IntelliJ IDEA.
- In the top menu bar of IntelliJ IDEA, choose .
- In the Deploy to Host dialog box, on the Deployment tab, configure the application deployment settings.
The following table describes the parameters.
Parameter Description File Select Maven Build, Upload File, or Gradle Build. - Maven Build: If your project uses Maven, build and deploy it directly.
- Upload File: If your project does not use Maven, or if a packaged deployment file exists on your local machine, select and upload the local deployment file.
- Gradle Build: If your project uses Gradle, select this option to build and deploy.
Target Host Click
on the right. In the drop-down list, select a tag. Then, select the server where you want to deploy the application.Target Directory Enter the deployment path on the server, such as /root/tomcat/webapps.Command Enter the application start command, such as sh /root/restart.sh. - In the Deploy to Host dialog box, click the Advanced tab and configure the following:
- In the Command area, enter the command to view real-time logs. For example:
Important On Windows systems, the Command field supports all PowerShell commands by default.
- Select the
Automatic open after deploycheckbox.
- In the Command area, enter the command to view real-time logs. For example:
- Click Run.
Result Verification
After the deployment starts, the built-in Terminal logs in to the server and displays the application's real-time log information.
Demonstration
该文章对您有帮助吗?