Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set intellij to show logs in the logs tab and not the output tab

When I use intellijs' (12.1.4) built-in tomcat the logs are being written to the output tab of the debug panel and not to a the normal localhost log tab.

I followed this document and added my log4j.properties which works fine in the output tab but it still does write the logs to right tab.

When I pack the project and deploy it on standalone tomcat I can see the logs.

Normally I would not care but the problem with the output tab is that you can not search in it.

This is my log4j and I have tired it both with ConsoleAppender and RollingFileAppender.

log4j.rootLogger=TRACE, A1

log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.File=${catalina.home}/logs/algo_js.log
log4j.appender.A1.MaxFileSize=500KB
log4j.appender.A1.MaxBackupIndex=5
log4j.appender.A1.layout=org.apache.log4j.PatternLayout

# Print the date in ISO 8601 format
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

Any ideas what I am missing?

Just clarify I added a pic. the top panel is where the logs are being shown and the bottom panel is where I would like it to be displayed ... where the search is

like image 952
special0ne Avatar asked Jun 18 '13 06:06

special0ne


People also ask

Why does IntelliJ IDEA show only the latest log 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.

Where are the logs being written to in intellijs' built-in Tomcat?

When I use intellijs' (12.1.4) built-in tomcat the logs are being written to the output tab of the debug panel and not to a the normal localhost log tab. I followed this document and added my log4j.properties which works fine in the output tab but it still does write the logs to right tab.

How does the log TAB work?

The log tab is named after the log file. If there are multiple log files enabled for a run/debug configuration, the tab name is composed of all the log file names delimited with the "|" characters. In this case, each specific log is displayed in its own tab: The logs can contain messages of the following types:

How do I get idea to automatically show logs when running?

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 Patternto match the file.


1 Answers

In the application server Run/Debug configuration open the Logs tab and specify the full log file path there.

You can just search your disk for algo_js.log file and specify its location.

like image 170
CrazyCoder Avatar answered Oct 08 '22 22:10

CrazyCoder