I just got a new PC at work and I'm giving IntelliJ IDEA Community Edition a go because I'm not the biggest fan of Eclipse. I figure now is the perfect time to try another IDE.
I can't seem to figure out how to see my app server logs/exceptions in the IDE, though. The closest thing I've found is to enable two checkboxes (they were unchecked on a fresh install) via:
Run --> Edit Configurations --> Application --> Logs (tab)
X Show console when standard out changes
X Show console when standard error changes
I'm just not finding any window/pane/tab with logs I can turn on. I've stopped/restarted my server, quit/relaunched IntelliJ.
Are server logs not available o view in the Community Edition IDE?
For Tomcat the actual logs are placed under CATALINA_BASE/logs directory. The value of the CATALINA_BASE set by IntelliJ IDEA will be printed in the console of the Run or Debug tool window. You can also find the log files under idea. system.
All notifications and events that occur in IntelliJ IDEA are gathered in the Notifications tool window. You can open the tool window by clicking the corresponding tool window bar on the right side of the editor. Alternatively, from the main menu, select View | Tool Windows | Notifications.
Most likely your server is writing to its own log files, and not to System.out or System.err. Where those are located will depend on your server. For example, Tomcat's logs will be in <tomcatInstallDir>/logs
. The Ultimate edition, which has server run configurations, will automatically open those logs (for most server types). For the Communality Edition, you will need to find where those logs are and then configure IDEA to automatically show them when you run your application.
On the "logs" tab, add a "Log file to be shown in console" by clicking the add button on the right. Then define the log file location. You can use an Ant File Pattern to match the file. This is useful for log files with a date in them. If you leave the "Show All files coverable by pattern" unchecked, IntelliJ IDEA will only show the latest/newest one. Finally, after creating the log definition, you can check the "Skip Content" button if you only want new messages shown when you launch the application/server (that is only messages from the current run. Messages from previous runs are not shown.)
Here's an example:
The above example was done in the Ultimate Edition. But the Community Edition has the same logs tab.
UPDATE
In response to your (first) comment, the log will appear as a tab on the run (or debug) tool window when you run your application. The tab name will match the alias you entered in the above configuration. For example:
Note: The text highlighting and output folding is done via the Grep Console Plug-in
I will mention a few "gotchas" with this feature:
I hope that helps.
I don't know about "Community Edition", but mine is IntelliJ Idea 15.0.3 & I found this one working for me. aplogies if yours is different version.
Go to View > Tool Windows > Application Servers
Now you can see server widget on the lower left side of IntelliJIdea Now, whenever you will debug / run the project, your server's log will be displayed here in the tab right of servers. (As, Tomcat Localhost Log & Tomcat Catalina Log in my case) shown in the attached screenshot below. Please refer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With