# Changing default Logs Dir in log4j.properties

**URL:** <https://community.wowza.com/t/changing-default-logs-dir-in-log4j-properties/33584>\
**Category:** Wowza Streaming Engine\
**Created:** [August 25, 2009, 9:11pm UTC](https://community.wowza.com/t/changing-default-logs-dir-in-log4j-properties/33584 "2009-08-25T21:11:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen\_Matteson](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Stephen\_Matteson](https://community.wowza.com/u/Stephen_Matteson)\
**Post date:** [August 25, 2009, 9:11pm UTC](https://community.wowza.com/t/changing-default-logs-dir-in-log4j-properties/33584/1 "2009-08-25T21:11:06Z")

</div>

I’m quite a newbie, using Wowza Media Server Pro10 1.7.0 build12081.

I have edited the log4j.properties file and notice that log files

are created (per application basis) in relation to the install-dir

parameter which by default on my Red-Hat Based system is:

/usr/local/WowzaMediaServerPro-1.7.0

Therefore, according to this line in log4j.properties:

[install-dir]/logs/[vhost]/[application]/wowzamediaserverpro\_access.log

My logs are getting written to a directory beneath /usr/local/WowzaMediaServerPro-1.7.0

How can I change the location of where log files are written?

The desired directory would be:

/home/vhost/steve-test/applications/shoutcast/logs

or something like that.

Thanks,

Stephen Matteson

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [August 26, 2009, 4:15am UTC](https://community.wowza.com/t/changing-default-logs-dir-in-log4j-properties/33584/2 "2009-08-26T04:15:36Z")

</div>

It is this line:

```auto
log4j.appender.${com.wowza.wms.context.VHost}_${com.wowza.wms.context.Application}_access.File=${com.wowza.wms.ConfigHome}/logs/${com.wowza.wms.context.VHost}/${com.wowza.wms.context.Application}/wowzamediaserver_access.log

```

If you want to change the root location just substitute this part:

```auto
${com.wowza.wms.ConfigHome}/logs

```

For the desired location. You may need to play around with it a little to get the variables in all the right spots for what you are looking for. It is hard to tell exactly from your description how you want it to work.

Charlie

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [September 2, 2009, 9:08am UTC](https://community.wowza.com/t/changing-default-logs-dir-in-log4j-properties/33584/3 "2009-09-02T09:08:36Z")

</div>

I really don’t have specific docs for this. It is fairly straight forward. First, just edit conf/log4j.properties and uncommand the per-application and per-vhost logging sections of this files. I think this is very clearly marked in the files. Then you can modify the out location using **File** property of each of the appenders. You can use variable as follows:

For both per-application and per-vhost you can use the variables:

```auto
${com.wowza.wms.ConfigHome} - Configuration home directory
${com.wowza.wms.context.VHostConfigHome} - Virtual host config directory

```

For per-vhost:

```auto
${com.wowza.wms.context.VHost} - vhost name

```

for per-application:

```auto
${com.wowza.wms.context.VHost} - vhost name
${com.wowza.wms.context.Application} - application name

```

It should be a piece of cake.

Charlie

---

<div class="post-metadata">

**Author:** ![Stephen\_Matteson](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Stephen\_Matteson](https://community.wowza.com/u/Stephen_Matteson)\
**Post date:** [September 1, 2009, 4:45pm UTC](https://community.wowza.com/t/changing-default-logs-dir-in-log4j-properties/33584/4 "2009-09-01T16:45:45Z")

</div>

Upon further consideration, I would like to output logging to two

different directories, and keep the Wowza Logging

“as is” under /usr/local/WowzaMediaServerPro-1.7.0.

These logs would be protected for System Administrator use.

For customer access and download, I would like to implement

per vhost and application logging in a different directory.

The directories would be readable and perhaps writable by the user.

So, for the vhost “steve-test”, I would like vhost logging to appear here:

/home/vhost/steve-test/logs

and per application logging (for shoutcast) to be located here:

/home/vhost/steve-test/applications/shoutcast/logs

If this sounds like a common implementation of logging for Wowza, hopefully you can point me to an existing tutorial, or some examples of this configuration.

Thank you!

Stephen Matteson
