# Database logging

**URL:** <https://community.wowza.com/t/database-logging/34096>\
**Category:** Wowza Streaming Engine\
**Tags:** server-administration\
**Created:** [March 27, 2016, 8:32pm UTC](https://community.wowza.com/t/database-logging/34096 "2016-03-27T20:32:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicholas\_Papadakos](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@Nicholas\_Papadakos](https://community.wowza.com/u/Nicholas_Papadakos)\
**Post date:** [March 27, 2016, 8:32pm UTC](https://community.wowza.com/t/database-logging/34096/1 "2016-03-27T20:32:31Z")

</div>

Hello,

after looking searching the forum i came to the conclusion that logging directly to database through log4j is not recommended.

Wouldn’t it be better if we just created a simple Java module and log everything to a db with the ondisconnect() function ?(or something similar)

or send them to a queue (like rabbitmq or Amazon SQS) to be processed by an other task ?

---

<div class="post-metadata">

**Author:** ![Andy\_Engberson](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/andy_engberson/32/392_2.png) [@Andy\_Engberson](https://community.wowza.com/u/Andy_Engberson)\
**Post date:** [April 4, 2016, 9:41am UTC](https://community.wowza.com/t/database-logging/34096/2 "2016-04-04T09:41:00Z")

</div>

You are correct that logging to mysql is not really recommended. We have several mechanisms for post log processing (can see our article for [SawMill](https://www.wowza.com/docs/how-to-use-sawmill-to-analyze-wowza-media-server-logs)).

You can certainly write your own logger by using the variety of event handlers we do have.

Andy E

---

<div class="post-metadata">

**Author:** ![Nicholas\_Papadakos](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@Nicholas\_Papadakos](https://community.wowza.com/u/Nicholas_Papadakos)\
**Post date:** [April 8, 2016, 10:53pm UTC](https://community.wowza.com/t/database-logging/34096/3 "2016-04-08T22:53:31Z")

</div>

hello,

i am actually interested about getting real time bandwidth data so i can limit application connection based on traffic.

You think i can do that with a parser ?

Or i could just get connection bandwidth data from the ondisconnect() of each client and then trigger a block of the application ?

---

<div class="post-metadata">

**Author:** ![J\_van\_Marion](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@J\_van\_Marion](https://community.wowza.com/u/J_van_Marion)\
**Post date:** [April 5, 2016, 12:36am UTC](https://community.wowza.com/t/database-logging/34096/4 "2016-04-05T00:36:21Z")

</div>

I did some testing on this (based on older forum posts) on version 3.6.4 and later on 4.0.x and indeed its not recommended. i got time outs and database connection issues pretty often, it doesnt reconnect. 2nd thing if you have quite some traffic on your server it will pile up quite some logs in your mysql database. You have to filter out quite some things in the log4jproperties. i quit the straight logging.

@Andy, what about support for Logstash. or do you only recommend Sawmill?

---

<div class="post-metadata">

**Author:** ![J\_van\_Marion](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@J\_van\_Marion](https://community.wowza.com/u/J_van_Marion)\
**Post date:** [June 30, 2016, 12:10am UTC](https://community.wowza.com/t/database-logging/34096/5 "2016-06-30T00:10:37Z")

</div>

> Hi,
> 
> With regards to log file parsing and analysis, we have the [following article](https://www.wowza.com/docs/how-to-use-sawmill-to-analyze-wowza-media-server-logs) on how to integrate Wowza with [Sawmill](http://www.sawmill.net/formats/wowza_media_server_pro.html)
> 
> We can also integrate with Google Analytics, which provides a very comprehensive stats reporting platform. You would need to install our ModuleAnalytics module and have a valid Google account. [This article](https://www.wowza.com/docs/how-to-send-connection-and-stream-statistics-to-google-analytics-analytics%28ModuleAnalytics%29) explains how to set this up,
> 
> Other log parsers that work with Wowza include:
> 
> [CasterStats](https://www.wowza.com/partners/casterstats)
> 
> [WMSPanel](https://wmspanel.com)
> 
> [Chainsaw](http://logging.apache.org/chainsaw/)

sorry for the late response( i didnt get a notice about a reply). I will do some testing on the google analytics. im quite curious about how that works. Thx for the link

---

<div class="post-metadata">

**Author:** ![Paul\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/paul_shields/32/390_2.png) [@Paul\_Shields](https://community.wowza.com/u/Paul_Shields)\
**Post date:** [April 7, 2016, 6:23pm UTC](https://community.wowza.com/t/database-logging/34096/6 "2016-04-07T18:23:22Z")

</div>

Hi,

> @Andy, what about support for Logstash. or do you only recommend Sawmill?
> 
> With regards to log file parsing and analysis, we have the [following article](https://www.wowza.com/docs/how-to-use-sawmill-to-analyze-wowza-media-server-logs) on how to integrate Wowza with [Sawmill](http://www.sawmill.net/formats/wowza_media_server_pro.html)
> 
> We can also integrate with Google Analytics, which provides a very comprehensive stats reporting platform. You would need to install our ModuleAnalytics module and have a valid Google account. [This article](https://www.wowza.com/docs/how-to-send-connection-and-stream-statistics-to-google-analytics-analytics%28ModuleAnalytics%29) explains how to set this up,
> 
> Other log parsers that work with Wowza include:
> 
> [CasterStats](https://www.wowza.com/partners/casterstats)
> 
> [WMSPanel](https://wmspanel.com)
> 
> [Chainsaw](http://logging.apache.org/chainsaw/)

---

<div class="post-metadata">

**Author:** ![Paul\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/paul_shields/32/390_2.png) [@Paul\_Shields](https://community.wowza.com/u/Paul_Shields)\
**Post date:** [April 11, 2016, 3:26pm UTC](https://community.wowza.com/t/database-logging/34096/7 "2016-04-11T15:26:12Z")

</div>

Hi,

There is some information logged that could be used to show data usage but it’s not something that could be called “realtime” due to the nature of logging. The [Users Guide](https://www.wowza.com/resources/WowzaStreamingEngine_UsersGuide.pdf) lists each of the log fields that you could use to calculate those types of values. You could also investigate using the REST API to [query these statistics](https://www.wowza.com/docs/statistics-query-examples).

If looking for a module method then [this article](https://www.wowza.com/docs/module-to-get-http-and-rtp-performance-statistics) has an example for HTTP and RTP streams. You could also look at [IMediaStreamActionNotify2](https://www.wowza.com/docs/imediastreamactionnotify2-example) and get IOPerformanceCounter stats when a client stops playing a stream at the onStop event.

Paul
