mirror of
https://github.com/Febbweiss/Fake-Apache-Log-Generator.git
synced 2026-03-04 14:25:34 +00:00
Fix: right way to use local timezone
This commit is contained in:
@@ -10,6 +10,8 @@ import sys
|
||||
import argparse
|
||||
from faker import Faker
|
||||
from random import randrange
|
||||
from tzlocal import get_localzone
|
||||
local = get_localzone()
|
||||
|
||||
#todo:
|
||||
# allow writing different patterns (Common Log, Apache Error log etc)
|
||||
@@ -84,7 +86,7 @@ while (flag):
|
||||
|
||||
ip = faker.ipv4()
|
||||
dt = otime.strftime('%d/%b/%Y:%H:%M:%S')
|
||||
tz = datetime.datetime.now().strftime('%z')
|
||||
tz = datetime.datetime.now(local).strftime('%z')
|
||||
vrb = numpy.random.choice(verb,p=[0.6,0.1,0.1,0.2])
|
||||
|
||||
uri = random.choice(resources)
|
||||
|
||||
@@ -2,3 +2,4 @@ fake-factory==0.7.2
|
||||
numpy==1.11.2
|
||||
Faker==0.7.3
|
||||
pytz==2016.7
|
||||
tzlocal==1.3.0
|
||||
Reference in New Issue
Block a user