-
1. Re: Webservice Audit logging ip-address
shawkins Apr 17, 2018 10:10 AM (in response to marc.kusters)> My question is as follows is is possible to log the ip-address of users with the logger shipped with Jboss Datavirtualization 6.3.8?
Currently the ip address of the web session will be that of the vm the driver is running in. So for OData that will be the the EAP server. The end user ip should be captured by Resteasy logging: RESTEasy JAX-RS - I'll see if I can verify what category/level captures it.
> We use DV internally and like to log users from within the network.
If you want this to directly be a Teiid feature, please log an upstream issue.
-
2. Re: Webservice Audit logging ip-address
rareddy Apr 17, 2018 10:13 AM (in response to marc.kusters)Audit log has the client IP address in it. For OData what kind of authentication you are using?
-
3. Re: Webservice Audit logging ip-address
marc.kusters Apr 17, 2018 10:40 AM (in response to rareddy)Currently we use the out of the box implementation, so basic username and password with roles defined in the application-users and application-roles. Later on we will switch to IAM.
-
4. Re: Webservice Audit logging ip-address
marc.kusters Apr 17, 2018 10:42 AM (in response to shawkins)That is true, we see the server IP address. I will have a look at the Resteasy logging. Thanks for both suggestions!
-
5. Re: Webservice Audit logging ip-address
shawkins Apr 18, 2018 4:30 PM (in response to marc.kusters)The clearest logging that I see is from undertow. From testing with localhost access:
TRACE [io.undertow.request] (default I/O-5) Opened connection with /127.0.0.1:50508
DEBUG [io.undertow.request] (default I/O-5) Matched prefix path /odata4 for path /odata4/loopy.1/MarketData/$metadata
-
6. Re: Webservice Audit logging ip-address
marc.kusters Apr 19, 2018 8:16 AM (in response to shawkins)That is more than enough.
If I understand correctly I need to add these lines to the standalone.xml?
<logger category="io.undertow.request">
<level name="TRACE"/>
<handlers>
<handler name="TEIID_AUDIT_LOG_ASYNC"/>
</handlers>
</logger>
Or do I need to add the undertow-io as a module and then add them as is described here:
Custom Logging - Teiid 9.0 (draft) - Project Documentation Editor
-
7. Re: Webservice Audit logging ip-address
shawkins Apr 19, 2018 8:49 AM (in response to marc.kusters)> If I understand correctly I need to add these lines to the standalone.xml?
Yes, that should be sufficient.
> Or do I need to add the undertow-io as a module and then add them as is described here
That doc is describing if you want to do something other than the default text logging. If you just want textual logs, then you just need to update the logging config.
-
8. Re: Webservice Audit logging ip-address
marc.kusters Apr 23, 2018 8:15 AM (in response to shawkins)I tried that and I got no results. Do you have an example configuration that I could use?
Perhaps I should use this?:
How to enable access logging for JBoss EAP 6 - Red Hat Customer Portal
-
9. Re: Webservice Audit logging ip-address
shawkins Apr 23, 2018 9:11 AM (in response to marc.kusters)Sorry Marc,
Yes that reference is good for EAP 6 / JDV 6.3. Undertow replaced jboss web in EAP 7, so my logging suggestion was only valid for Teiid community.
-
10. Re: Webservice Audit logging ip-address
marc.kusters Apr 23, 2018 10:50 AM (in response to shawkins)No problem, I got it working using the following commands:
batch
/subsystem=web/virtual-server=default-host/configuration=access-log:add
/subsystem=web/virtual-server=default-host/configuration=access-log:write-attribute(name="pattern",value="%h %l %u %t \"%r\" %s %b %S %T")
/subsystem=web/virtual-server=default-host/configuration=access-log/setting=directory:add
/subsystem=web/virtual-server=default-host/configuration=access-log/setting=directory:write-attribute(name="path",value="./")
/subsystem=web/virtual-server=default-host/configuration=access-log/setting=directory:write-attribute(name="relative-to",value="jboss.server.log.dir")
run-batch
The reference to undertow is nice as it shows which values I can use for the pattern!
Thanks for helping me!