Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC: Is it possible to write logs into jazz.log file located in RTC Server machine

Hi Ralph,

Can you please help me on this requirement?

I just want to programmatically write logger statements from my plugin to jazz.log file located in RTC Server location.

I use JAZZ Admin User ID[which has admin access as well as root access for permissions] to login to RTC Server and trying to write logger statements into Jazz.log file. Getting the below exception,

Exception=java.io.FileNotFoundException

: \opt\IBM\Demo_JazzTeamServer_4.0.6\server\logs\ccm.log (The system cannot find the path specified.)


Kindly help on this!

Thanks

Sudar

0 votes

Comments

Actually, i could write the logs into jazz.log file using the below steps, but problem is, i couldn't append the lines into file, instead of overriding the file now.

1) Programmatically, I login to server by rtcadmin login[added in admin group ids, has required permissions to write and read the file]

2) Using ChannelSftp and OutputStream,  i write logs into jazz.log file.

But, only thing, i need to append the lines instead of overriding the file content. I tried FileOutputStreams and method of writing a file. Didn't work.

Kindly help me if you have any other idea.

Thanks,

Sudar


Accepted answer

Permanent link
From within a server extension you can get the log using

.getLog()

and then log data. This assumes that your extension is based on the class AbstractService as it should be.
Sudaraazhi Arivalagan selected this answer as the correct answer

0 votes

Comments

Thanks Ralph !

Ralph,

Actually, i would require to log from my Client-side plugin into jazz.log. Kindly advice on this.

Is there a way to write logger from Client-side plugin into jazz.log file?

You can't, unless you write something that talks to something in the server that has the log file open using the aforementioned method getLog(). For local logging, this is what I found:

    public void log(String message, Throwable exception) {
        FoundationLog.getLog(PLUGIN_ID).error(message, exception);
    }

PS if you try to open that file and write from a second source, you will either fail or mess up the logs.

you could always create a logger service that your client uses.  requires you to install you service plugin on the server..

Thanks Ralph and Sam !!

showing 5 of 7 show 2 more comments

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Apr 02 '15, 5:20 a.m.

Question was seen: 4,305 times

Last updated: Apr 03 '19, 12:05 a.m.

Confirmation Cancel Confirm