logging to the user console

I want to write some my plugin logs to the user console likewise System.out.println(). How to implement it? Is it possible with log4j or something another (except System.out.println()) :) ?
Thanks

8 comments
Comment actions Permalink

there's a log.xml file in the $IDEA_install_dir/bin directory.

And IDEA publishes a Logger (com.intellij.openapi.diagnostic.Logger) that is used like any Log4j logger.

Does that solve your problem ?

0
Comment actions Permalink

Yes, it does. I have used com.intellij.openapi.diagnostic.Logger .
Thanks you very match:)

0
Comment actions Permalink

I need logging from my plugin to specify path.How to set IDEA Logger (com.intellij.openapi.diagnostic.Logger) for that?
Thanks.

0
Comment actions Permalink

Open API doesn't consists solution for that:(..

Message was edited by:
Denis Alexandrov

0
Comment actions Permalink

I have added into log.xml "own" appender:


]]>
<param name="ConversionPattern" value="%d %6p - %30.30c - %m \n"/>
]]>


Log file is created but nothing to write into it. Log is empty..
Can anyone tell me What Did I Do Wrong?
Thanks

0
Comment actions Permalink

I'am sorry.Problem is solved .

Message was edited by:
Denis Alexandrov

0
Comment actions Permalink

I have created own ConsoleView like below:

ToolWindowManager manager = ToolWindowManager.getInstance(project);
String id = "Test";
TextConsoleBuilderFactory factory = TextConsoleBuilderFactory.getInstance();
ConsoleView view = factory.createBuilder(project).getConsole();

ToolWindow window = manager.getToolWindow(id);

// etc..

And I have created "own logging" as I have been telling in previous post.
I want that my logs from my package has been printing in my "own logging":)



Do You Have Any Idea?:)...

Message was edited by:
Denis Alexandrov

0
Comment actions Permalink

How can I attach my ConsoleView to our idea log4j process with method attachToProcess(ProcessHandler processHandler) ?

Sample "our idea log4j process w" in the screenshot.

Message was edited by:
Denis Alexandrov



Attachment(s):
2.jpg
0

Please sign in to leave a comment.