# Audit/Access Log Java API

**URL:** <https://community.stardog.com/t/audit-access-log-java-api/115>\
**Category:** Support\
**Created:** [February 16, 2017, 10:28pm UTC](https://community.stardog.com/t/audit-access-log-java-api/115 "2017-02-16T22:28:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arwesterinen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/arwesterinen/32/40_2.png) [@arwesterinen](https://community.stardog.com/u/arwesterinen)\
**Post date:** [February 16, 2017, 10:28pm UTC](https://community.stardog.com/t/audit-access-log-java-api/115/1 "2017-02-16T22:28:43Z")

</div>

I know that there is a stardog-admin log print function. I can’t seem to find a way to get this output via a Java API.

I need to integrate the stardog log info with other logging details from my application.

Any suggestions (besides shelling out to the command line)?

Thanks.  
Andrea

---

<div class="post-metadata">

**Author:** ![evren](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/evren/32/1515_2.png) [@evren](https://community.stardog.com/u/evren)\
**Post date:** [February 17, 2017, 1:44am UTC](https://community.stardog.com/t/audit-access-log-java-api/115/2 "2017-02-17T01:44:24Z")

</div>

Hi Andrea,

I put an example of how to read audit log files programmatically here:

> <https://gist.github.com/evren/637d944277696cb70b2f6830e1af6896#file-printprotobuflogs-java>

The first argument is the file path, the second argument is either the string "text" or "binary" depending on what format was specified in stardog.properties for the log file. `KernelEvent` class is not in the published javadocs (we'll include it there later) but it is a very simple interface. Let us know if you have questions.

You'll need a dependency on "com.complexible.stardog.logging:stardog-logging-api:${stardogVersion}" for this to work.

Best,  
Evren

---

<div class="post-metadata">

**Author:** ![arwesterinen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/arwesterinen/32/40_2.png) [@arwesterinen](https://community.stardog.com/u/arwesterinen)\
**Post date:** [February 17, 2017, 1:04pm UTC](https://community.stardog.com/t/audit-access-log-java-api/115/3 "2017-02-17T13:04:27Z")

</div>

Excellent, thank you!  
Andrea

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [March 3, 2017, 1:04pm UTC](https://community.stardog.com/t/audit-access-log-java-api/115/4 "2017-03-03T13:04:53Z")

</div>

Closed on March 3, 2017, 1:04pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
