Closed edalzell closed 7 years ago
My timezone is set properly
Is your timezone set in system.yaml ?
Yes, timezone: America/Vancouver
Looks fine right now.
Happening on my live site
Regarding #927, if I set the timezone
in my settings, the actually message is timestamped correctly but the file is created incorrectly.
Which means, that if I don't have the timezone set it is NOT using the right PHP default, which should be date.timezone
.
I don't have the timezone
set in my system.yaml
and your boot loader uses that:
// Set the timezone. Override Laravel's config, and set in PHP
config(['app.timezone' => Config::get('system.timezone')]);
date_default_timezone_set(config('app.timezone'));
This still occurs for me...
Alrighty.
See name of file and screenshot.
OK more debugging:
protected function registerStreamHandler($config)
{
dd(date_default_timezone_get());
Produces UTC
. So this is being called either before the boot loader that sets it, or, default timezone gets reset by the time it's called here.
Yup, Logging is done in app.php
, line 68:
$app->configureMonologUsing(function($monolog) {
new Statamic\Logging\LoggingHandler($monolog);
});
Which I suspect is before this gets called:
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot()
{
// Set the site's locale
site_locale(LOCALE);
// Set the timezone. Override Laravel's config, and set in PHP
config(['app.timezone' => Config::get('system.timezone')]);
date_default_timezone_set(config('app.timezone'));
Just move this code:
// Set the timezone. Override Laravel's config, and set in PHP
config(['app.timezone' => Config::get('system.timezone')]);
date_default_timezone_set(config('app.timezone'));
To app.php.
Unfortunately I spoke too soon. It's not working yet...
I could never replicate the behavior of the future logs, but at the location in @edalzell 's comment, the right timezone is now reflected.
for you @jasonvarga, you'd have to have no log file and try it after 7pm your time I think, in order to get the next days date.
Steps to reproduce
Expected behaviour
Filename should have todays date
Actual behaviour