Added above mentioned code block to the router.jag file
Then the logs will be printed as...

[2016-07-04 10:48:00,050]  INFO -  User : [email protected], Action :
createDatabaseAndAttachUser
[2016-07-04 10:48:06,300]  INFO -  User : [email protected], Action :
dropDatabase
[2016-07-04 10:48:08,406]  INFO -  User : [email protected], Action :
dropDatabase
[2016-07-04 10:48:15,675]  INFO -  User : [email protected], Action :
createDatabaseAndAttachUser
[2016-07-04 10:48:24,817]  INFO -  User : [email protected], Action :
createDatabaseUser



On Sun, Jul 3, 2016 at 4:17 PM, Mahesh Chinthaka <[email protected]> wrote:

> Hi Amalka,
>
> All the requests/actions go through it (router.jag).
>
>
>
> On Sun, Jul 3, 2016 at 7:16 AM, Amalka Subasinghe <[email protected]> wrote:
>
>> Hi,
>>
>> We can log adding following to the jaggery.
>>
>> var audit = org.wso2.carbon.CarbonConstants.AUDIT_LOG;
>> audit.info("User : " + jagg.getUser() + ", Action : " +  action);
>>
>> Here. I want to log who is the user logged in and what action he called.
>> Would it be ok to add this code to the router jag in app cloud? As I know
>> all requests/actions go through it. am I right?
>>
>> Thanks
>> Amalka
>>
>> On Fri, Jul 1, 2016 at 12:13 PM, Amalka Subasinghe <[email protected]>
>> wrote:
>>
>>> Hi,
>>>
>>> I have a Jaggery app deployed in WSO2AS, I want to log user activities
>>> via block layer to a separate file (to audit.log).
>>> Please help.
>>>
>>> Thanks
>>> Amalka
>>>
>>>
>>
>>
>> --
>> Amalka Subasinghe
>>
>> WSO2 Inc.
>> Mobile: +94 77 9401267
>>
>
>
>
> --
> *Mahesh Chinthaka Vidanagama* | Software Engineer
> WSO2, Inc | lean. enterprise. middleware.
> #20, Palm Grove, Colombo 03, Sri Lanka
> Mobile: +94 71 63 63 083 | Work: +94 112 145 345
> Email: [email protected] | Web: www.wso2.com
>



-- 
Amalka Subasinghe

WSO2 Inc.
Mobile: +94 77 9401267
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to