Commit 5d410aa8 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch...

Merge branch '214108-log-explorer-timestamp-in-the-logs-presented-in-utc-and-should-be-in-user-local' into 'master'

Display local timezone in logs

Closes #214108

See merge request gitlab-org/gitlab!29409
parents 89870ebb 9e66d0c5
export const dateFormatMask = 'UTC:mmm dd HH:MM:ss.l"Z"'; export const dateFormatMask = 'mmm dd HH:MM:ss.l';
export const TOKEN_TYPE_POD_NAME = 'TOKEN_TYPE_POD_NAME'; export const TOKEN_TYPE_POD_NAME = 'TOKEN_TYPE_POD_NAME';
---
title: Display local timezone in log explorer
merge_request: 29409
author:
type: changed
...@@ -57,7 +57,9 @@ describe 'Environment > Pod Logs', :js do ...@@ -57,7 +57,9 @@ describe 'Environment > Pod Logs', :js do
expect(item.text).to eq(pod_names[i]) expect(item.text).to eq(pod_names[i])
end end
end end
expect(page).to have_content("Dec 13 14:04:22.123Z | kube-pod | Log 1 Dec 13 14:04:23.123Z | kube-pod | Log 2 Dec 13 14:04:24.123Z | kube-pod | Log 3") expect(page).to have_content("kube-pod | Log 1")
expect(page).to have_content("kube-pod | Log 2")
expect(page).to have_content("kube-pod | Log 3")
end end
end end
end end
...@@ -34,91 +34,31 @@ export const mockPods = [ ...@@ -34,91 +34,31 @@ export const mockPods = [
export const mockLogsResult = [ export const mockLogsResult = [
{ {
timestamp: '2019-12-13T13:43:18.2760123Z', timestamp: '2019-12-13T13:43:18.2760123Z',
message: '10.36.0.1 - - [16/Oct/2019:06:29:48 UTC] "GET / HTTP/1.1" 200 13', message: 'log line 1',
pod: 'foo', pod: 'foo',
}, },
{ {
timestamp: '2019-12-13T13:43:18.2760123Z', timestamp: '2019-12-13T13:43:18.2760123Z',
message: '- -> /', message: 'log line A',
pod: 'bar', pod: 'bar',
}, },
{ {
timestamp: '2019-12-13T13:43:26.8420123Z', timestamp: '2019-12-13T13:43:26.8420123Z',
message: '10.36.0.1 - - [16/Oct/2019:06:29:57 UTC] "GET / HTTP/1.1" 200 13', message: 'log line 2',
pod: 'foo', pod: 'foo',
}, },
{ {
timestamp: '2019-12-13T13:43:26.8420123Z', timestamp: '2019-12-13T13:43:26.8420123Z',
message: '- -> /', message: 'log line B',
pod: 'bar',
},
{
timestamp: '2019-12-13T13:43:28.3710123Z',
message: '10.36.0.1 - - [16/Oct/2019:06:29:58 UTC] "GET / HTTP/1.1" 200 13',
pod: 'foo',
},
{
timestamp: '2019-12-13T13:43:28.3710123Z',
message: '- -> /',
pod: 'bar',
},
{
timestamp: '2019-12-13T13:43:36.8860123Z',
message: '10.36.0.1 - - [16/Oct/2019:06:30:07 UTC] "GET / HTTP/1.1" 200 13',
pod: 'foo',
},
{
timestamp: '2019-12-13T13:43:36.8860123Z',
message: '- -> /',
pod: 'bar',
},
{
timestamp: '2019-12-13T13:43:38.4000123Z',
message: '10.36.0.1 - - [16/Oct/2019:06:30:08 UTC] "GET / HTTP/1.1" 200 13',
pod: 'foo',
},
{
timestamp: '2019-12-13T13:43:38.4000123Z',
message: '- -> /',
pod: 'bar',
},
{
timestamp: '2019-12-13T13:43:46.8420123Z',
message: '10.36.0.1 - - [16/Oct/2019:06:30:17 UTC] "GET / HTTP/1.1" 200 13',
pod: 'foo',
},
{
timestamp: '2019-12-13T13:43:46.8430123Z',
message: '- -> /',
pod: 'bar',
},
{
timestamp: '2019-12-13T13:43:48.3240123Z',
message: '10.36.0.1 - - [16/Oct/2019:06:30:18 UTC] "GET / HTTP/1.1" 200 13',
pod: 'foo',
},
{
timestamp: '2019-12-13T13:43:48.3250123Z',
message: '- -> /',
pod: 'bar', pod: 'bar',
}, },
]; ];
export const mockTrace = [ export const mockTrace = [
'Dec 13 13:43:18.276Z | foo | 10.36.0.1 - - [16/Oct/2019:06:29:48 UTC] "GET / HTTP/1.1" 200 13', 'Dec 13 13:43:18.276 | foo | log line 1',
'Dec 13 13:43:18.276Z | bar | - -> /', 'Dec 13 13:43:18.276 | bar | log line A',
'Dec 13 13:43:26.842Z | foo | 10.36.0.1 - - [16/Oct/2019:06:29:57 UTC] "GET / HTTP/1.1" 200 13', 'Dec 13 13:43:26.842 | foo | log line 2',
'Dec 13 13:43:26.842Z | bar | - -> /', 'Dec 13 13:43:26.842 | bar | log line B',
'Dec 13 13:43:28.371Z | foo | 10.36.0.1 - - [16/Oct/2019:06:29:58 UTC] "GET / HTTP/1.1" 200 13',
'Dec 13 13:43:28.371Z | bar | - -> /',
'Dec 13 13:43:36.886Z | foo | 10.36.0.1 - - [16/Oct/2019:06:30:07 UTC] "GET / HTTP/1.1" 200 13',
'Dec 13 13:43:36.886Z | bar | - -> /',
'Dec 13 13:43:38.400Z | foo | 10.36.0.1 - - [16/Oct/2019:06:30:08 UTC] "GET / HTTP/1.1" 200 13',
'Dec 13 13:43:38.400Z | bar | - -> /',
'Dec 13 13:43:46.842Z | foo | 10.36.0.1 - - [16/Oct/2019:06:30:17 UTC] "GET / HTTP/1.1" 200 13',
'Dec 13 13:43:46.843Z | bar | - -> /',
'Dec 13 13:43:48.324Z | foo | 10.36.0.1 - - [16/Oct/2019:06:30:18 UTC] "GET / HTTP/1.1" 200 13',
'Dec 13 13:43:48.325Z | bar | - -> /',
]; ];
export const mockResponse = { export const mockResponse = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment