# Adding info to log files and not overwriting

**URL:** <https://forum.mautic.org/t/adding-info-to-log-files-and-not-overwriting/11280>\
**Category:** Product Support\
**Created:** [October 2, 2019, 10:49am UTC](https://forum.mautic.org/t/adding-info-to-log-files-and-not-overwriting/11280 "2019-10-02T10:49:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![simas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/simas/32/724_2.png) [@simas](https://forum.mautic.org/u/simas)\
**Post date:** [October 2, 2019, 10:49am UTC](https://forum.mautic.org/t/adding-info-to-log-files-and-not-overwriting/11280/1 "2019-10-02T10:49:32Z")

</div>

My Mautic version is: 2.15.2  
My PHP version is: 7.2.19

I’m using for example “…domain.com/public\_html/mautic/segments\_update.log 2\>&1” command to put the output of the cronjob to the log. The problem is that every time the cronjob is run, the output of the job is written over the old one, so I can’t see if past jobs were ok. Is there a way to add the outputs to the existing ones and not to overwrite them?

One more log related side question:  
I’ve added a command to create cronjob “email:send” log file, but it’s empty all the time. Can this be related to that I am using my php mail at the moment as I am still testing my Mautic setup? Or should I look for problems elsewhere? The emails are being sent.

Thank you 👍

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [October 2, 2019, 4:54pm UTC](https://forum.mautic.org/t/adding-info-to-log-files-and-not-overwriting/11280/2 "2019-10-02T16:54:16Z")

</div>

A quick search yielded this thread: [https://serverfault.com/questions/499054/getting-cron-logs-to-add-to-file-not-override-it/499055](https://serverfault.com/questions/499054/getting-cron-logs-to-add-to-file-not-override-it/499055) which should answer part 1.

In regards to the second question, are you sending emails immediately or using the queue? Are you using the : in the filename? If so that might cause an issue.

---

<div class="post-metadata">

**Author:** ![simas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/simas/32/724_2.png) [@simas](https://forum.mautic.org/u/simas)\
**Post date:** [October 3, 2019, 1:32pm UTC](https://forum.mautic.org/t/adding-info-to-log-files-and-not-overwriting/11280/3 "2019-10-03T13:32:29Z")

</div>

Thank you for your reply.

> [@silavapi](#):
>
> A quick search yielded this thread: [linux - Getting cron logs to add to file, not override it - Server Fault](https://serverfault.com/questions/499054/getting-cron-logs-to-add-to-file-not-override-it/499055) which should answer part 1.

thank you, it seems that your search skills are better than mine 😊

> [@silavapi](#):
>
> In regards to the second question, are you sending emails immediately or using the queue? Are you using the : in the filename? If so that might cause an issue.

I am sending in queue. The logging functionality by itself is working ok, cause when I turn the queue off, I’m getting an output message “Mautic is not set to queue email” to my log file every time the email:send cronjob is executed… and then I turn the queue on again, I get no output message again

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [October 3, 2019, 4:00pm UTC](https://forum.mautic.org/t/adding-info-to-log-files-and-not-overwriting/11280/4 "2019-10-03T16:00:57Z")

</div>

What output do you get if you run it at command line? That might give you an indication as to what you might expect to see. Not sure what is actually output in the email send cron myself!

---

<div class="post-metadata">

**Author:** ![simas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/simas/32/724_2.png) [@simas](https://forum.mautic.org/u/simas)\
**Post date:** [October 3, 2019, 4:47pm UTC](https://forum.mautic.org/t/adding-info-to-log-files-and-not-overwriting/11280/5 "2019-10-03T16:47:01Z")

</div>

it’s the same. If I run a script on a command line, I get no output to my email\_send.log and a normal output to a corresponding logs if I run every other script

---

<div class="post-metadata">

**Author:** ![deepti](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/deepti/32/411_2.png) [@deepti](https://forum.mautic.org/u/deepti)\
**Post date:** [October 3, 2019, 5:08pm UTC](https://forum.mautic.org/t/adding-info-to-log-files-and-not-overwriting/11280/6 "2019-10-03T17:08:44Z")

</div>

that means you did not sey up cron jobs properly

---

<div class="post-metadata">

**Author:** ![simas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/simas/32/724_2.png) [@simas](https://forum.mautic.org/u/simas)\
**Post date:** [October 3, 2019, 5:16pm UTC](https://forum.mautic.org/t/adding-info-to-log-files-and-not-overwriting/11280/7 "2019-10-03T17:16:27Z")

</div>

> [@deepti](#):
>
> that means you did not sey up cron jobs properly

what do you mean? I do send and receive the email on time indicated by my cronjob. And do get the output to email\_send.log if I change from queued to immediate my email sending settings. I just don’t get any log output if I use queue.

> [@simas](#):
>
> it’s the same. If I run a script on a command line, I get no output to my email\_send.log and a normal output to a corresponding logs if I run every other script

I also ran email:send command directly from command line (not by the help of a script as in case above) and do not get any output on terminal screen either. The email is being sent.
