Logging in kibana dashboard

Six Stars

Logging in kibana dashboard

Hi
I have some jobs in which I am printing some usefull information through system.out.println.
I have created one task in TAC to execute my job.
I wanted to log those messages in Kibana dashboard  as message.
Need suggestion How I can achive it. 
Thanks
Ashish
One Star

Re: Logging in kibana dashboard

You can redirect your logs in the Talend job to a file using a tJava at the start of the job. In the tJava, you place the following code - or something like it
java.io.File myLogFile = new java.io.File("C:/workbench/myTalendJobLogFile.log");
java.io.PrintStream ps = new java.io.PrintStream(new java.io.FileOutputStream(myLogFile));
System.setErr(ps);
System.setOut(ps);

You can make the file name dynamic for all your jobs per project, and time stamp them to segregate logging over time: 
java.io.File myLogFile = new java.io.File("C:/workbench/" + projectName +”_”+ jobName + "_" + TalendDate.getDate(“CCYYMMDDhhmmss”)+”.log”)

Finally, you'd point Kibana to the directory where you're capturing your logs - C:workbench in this example. Kibana would consume those logs and populate its dashboard...
Six Stars

Re: Logging in kibana dashboard

Hi 
Thanks willm for the reply and suggestion currently exactly the same  way I am doing.
But As per my requirement we should not make any changes in job level.
As job server used to execute our task so those message it would be printing somewhere in console but I am not getting where it is printing so that I can directly defined those configuration in logstash_talend.cfg file and take it from console directly.
Sorry My requirement is totaly crazy..Smiley Happy
Thanks
Ashish