Setting Timezone breaks audit log #3864

Closed
opened 2026-02-05 07:42:51 +03:00 by OVERLORD · 13 comments
Owner

Originally created by @WebWalker3D on GitHub (Jun 16, 2023).

Describe the Bug

Everything is being recorded in UTC. This is because the file app.php on line 74 sets it as such. I also understand to fix this, I simply need to add the line APP_TIMEZONE=America/New_York in the .env and this should correct the timezone issue. Unfortunately, what ends up happening instead is the audit log stops recording any of the logs. Unsetting this in .env fixes the audit log recording.

Steps to Reproduce

  1. Open .env
  2. add line APP_TIMEZONE=America/New_York
  3. save file

Expected Behaviour

  1. Open .env
  2. add line APP_TIMEZONE=America/New_York
  3. save file
  4. audit log still records in America/New_York time

Screenshots or Additional Context

php.ini date.timezone is set correctly See also #2509

Browser Details

No response

Exact BookStack Version

v23.02.2

PHP Version

8.2.7

Hosting Environment

Ubuntu 22.04.2 LTS VPS @ Digital Ocean, installed following the install instructions for production

Originally created by @WebWalker3D on GitHub (Jun 16, 2023). ### Describe the Bug Everything is being recorded in UTC. This is because the file app.php on line 74 sets it as such. I also understand to fix this, I simply need to add the line `APP_TIMEZONE=America/New_York` in the .env and this should correct the timezone issue. Unfortunately, what ends up happening instead is the audit log stops recording _any_ of the logs. Unsetting this in .env fixes the audit log recording. ### Steps to Reproduce 1. Open .env 2. add line APP_TIMEZONE=America/New_York 3. save file ### Expected Behaviour 1. Open .env 2. add line APP_TIMEZONE=America/New_York 3. save file 4. audit log still records in America/New_York time ### Screenshots or Additional Context php.ini date.timezone is set correctly See also #2509 ### Browser Details _No response_ ### Exact BookStack Version v23.02.2 ### PHP Version 8.2.7 ### Hosting Environment Ubuntu 22.04.2 LTS VPS @ Digital Ocean, installed following the install instructions for production
OVERLORD added the 🐛 Bug label 2026-02-05 07:42:51 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jun 17, 2023):

Hi @WebWalker3D,
Just tested this, setting APP_TIMEZONE=America/New_York works for me.

Unfortunately, what ends up happening instead is the audit log stops recording any of the logs.

Are you sure this is the case?
And it's not the case that the logs are being recorded, but are just showing up below some of the older UTC logs (Which are recorded with a latter time)? This can happen when going back in time like you're doing here.

@ssddanbrown commented on GitHub (Jun 17, 2023): Hi @WebWalker3D, Just tested this, setting `APP_TIMEZONE=America/New_York` works for me. > Unfortunately, what ends up happening instead is the audit log stops recording any of the logs. Are you sure this is the case? And it's not the case that the logs are being recorded, but are just showing up below some of the older UTC logs (Which are recorded with a latter time)? This can happen when going back in time like you're doing here.
Author
Owner

@WebWalker3D commented on GitHub (Jun 17, 2023):

Yes, 100% positive. If I turn the .env variable on, nothing further is logged in audit log for anything, ever. The second I remove this from .env everything works again as expected, just UTC

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Dan Brown @.>
Sent: Friday, June 16, 2023 5:22:58 PM
To: BookStackApp/BookStack @.
>
Cc: WebWalker3D @.>; Mention @.>
Subject: Re: [BookStackApp/BookStack] Setting Timezone breaks audit log (Issue #4324)

Hi @WebWalker3Dhttps://github.com/WebWalker3D,
Just tested this, setting APP_TIMEZONE=America/New_York works for me.

Unfortunately, what ends up happening instead is the audit log stops recording any of the logs.

Are you sure this is the case?
And it's not the case that the logs are being recorded, but are just showing up below some of the older UTC logs (Which are recorded with a latter time)? This can happen when going back in time like you're doing here.


Reply to this email directly, view it on GitHubhttps://github.com/BookStackApp/BookStack/issues/4324#issuecomment-1595332274, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BATMYSN2MFCE3K4SM6JOL6TXLTFDFANCNFSM6AAAAAAZJQWXTA.
You are receiving this because you were mentioned.Message ID: @.***>

@WebWalker3D commented on GitHub (Jun 17, 2023): Yes, 100% positive. If I turn the .env variable on, nothing further is logged in audit log for anything, ever. The second I remove this from .env everything works again as expected, just UTC Get Outlook for Android<https://aka.ms/AAb9ysg> ________________________________ From: Dan Brown ***@***.***> Sent: Friday, June 16, 2023 5:22:58 PM To: BookStackApp/BookStack ***@***.***> Cc: WebWalker3D ***@***.***>; Mention ***@***.***> Subject: Re: [BookStackApp/BookStack] Setting Timezone breaks audit log (Issue #4324) Hi @WebWalker3D<https://github.com/WebWalker3D>, Just tested this, setting APP_TIMEZONE=America/New_York works for me. Unfortunately, what ends up happening instead is the audit log stops recording any of the logs. Are you sure this is the case? And it's not the case that the logs are being recorded, but are just showing up below some of the older UTC logs (Which are recorded with a latter time)? This can happen when going back in time like you're doing here. — Reply to this email directly, view it on GitHub<https://github.com/BookStackApp/BookStack/issues/4324#issuecomment-1595332274>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BATMYSN2MFCE3K4SM6JOL6TXLTFDFANCNFSM6AAAAAAZJQWXTA>. You are receiving this because you were mentioned.Message ID: ***@***.***>
Author
Owner

@ssddanbrown commented on GitHub (Jun 17, 2023):

@WebWalker3D With the timezone changed as desired, If you create a completely new book, then create a new page within that book, then update that page, do these actions show in the sidebar when going back up and viewing that new book? Under the "Recent Activity" heading.

@ssddanbrown commented on GitHub (Jun 17, 2023): @WebWalker3D With the timezone changed as desired, If you create a completely new book, then create a new page within that book, then update that page, do these actions show in the sidebar when going back up and viewing that new book? Under the "Recent Activity" heading.
Author
Owner

@WebWalker3D commented on GitHub (Jun 17, 2023):

Large Screenshot

Screenshot_20230616_173543_Chrome

@WebWalker3D commented on GitHub (Jun 17, 2023): <details><summary>Large Screenshot</summary> <p> ![Screenshot_20230616_173543_Chrome](https://github.com/BookStackApp/BookStack/assets/136760393/a3747e3c-466b-4147-b70e-d0709c03e79c) </p> </details>
Author
Owner

@WebWalker3D commented on GitHub (Jun 17, 2023):

These times are +4 ahead. It's UTC still

@WebWalker3D commented on GitHub (Jun 17, 2023): These times are +4 ahead. It's UTC still
Author
Owner

@WebWalker3D commented on GitHub (Jun 17, 2023):

If I make the change in the .env file, nothing logs ever in the audit

@WebWalker3D commented on GitHub (Jun 17, 2023): If I make the change in the .env file, nothing logs ever in the audit
Author
Owner

@ssddanbrown commented on GitHub (Jun 17, 2023):

@WebWalker3D Please can you respond based upon the specific steps in my last comment?

@ssddanbrown commented on GitHub (Jun 17, 2023): @WebWalker3D Please can you respond based upon the specific steps in my last comment?
Author
Owner

@WebWalker3D commented on GitHub (Jun 17, 2023):

Screenshot_20230616_175652_Chrome
It's the same as you asked

@WebWalker3D commented on GitHub (Jun 17, 2023): ![Screenshot_20230616_175652_Chrome](https://github.com/BookStackApp/BookStack/assets/136760393/1d83c0f3-405b-4854-b11b-3bab5f9404c9) It's the same as you asked
Author
Owner

@ssddanbrown commented on GitHub (Jun 17, 2023):

@WebWalker3D That's not what I asked. I'll reformat the steps into bullet points, and specify what to screenshot:

  • Create a completely new book
  • Then create a new page within that book.
  • Then update that page.
  • View the book from the first step.
  • Find the "Recent Activity" list in the sidebar.
    • On mobile, this will be under the "Info" top tab, instead of a sidebar.
  • Screenshot the "Recent Activity" list along with any entries in this list.
@ssddanbrown commented on GitHub (Jun 17, 2023): @WebWalker3D That's not what I asked. I'll reformat the steps into bullet points, and specify what to screenshot: - Create a completely new book - Then create a new page within that book. - Then update that page. - View the book from the first step. - Find the "Recent Activity" list in the sidebar. - On mobile, this will be under the "Info" top tab, instead of a sidebar. - Screenshot the "Recent Activity" list along with any entries in this list.
Author
Owner

@WebWalker3D commented on GitHub (Jun 17, 2023):

Alright. I'll update on Sunday when I'm in front of a computer and not mobile. Appreciate your time my friend

@WebWalker3D commented on GitHub (Jun 17, 2023): Alright. I'll update on Sunday when I'm in front of a computer and not mobile. Appreciate your time my friend
Author
Owner

@WebWalker3D commented on GitHub (Jun 18, 2023):

I'm stupid, sorry. lol

@WebWalker3D commented on GitHub (Jun 18, 2023): I'm stupid, sorry. lol
Author
Owner

@ssddanbrown commented on GitHub (Jun 18, 2023):

Was data being recorded as expected, but just below/behind existing audit log entries as per my first response?

@ssddanbrown commented on GitHub (Jun 18, 2023): Was data being recorded as expected, but just below/behind existing audit log entries as per my first response?
Author
Owner

@WebWalker3D commented on GitHub (Jun 18, 2023):

It was. I just didn't see it because the system was being used so there was a bunch of logs. Today with it not being used, it was easy to see.

@WebWalker3D commented on GitHub (Jun 18, 2023): It was. I just didn't see it because the system was being used so there was a bunch of logs. Today with it not being used, it was easy to see.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3864