Skip to content

Commit

Permalink
fix(log-shared): timestamp format
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Antonio Ghiani committed Jan 15, 2024
1 parent fcc90f4 commit 6c325c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ export const CategoryExampleMessage: React.FunctionComponent<{
const openMenu = useCallback(() => setIsMenuOpen(true), []);
const closeMenu = useCallback(() => setIsMenuOpen(false), []);

const time = moment(timestamp).toISOString();

const viewInStreamLinkProps = useLinkProps({
app: 'logs',
pathname: 'stream',
search: {
logPosition: encode({
end: moment(timeRange.endTime).format('YYYY-MM-DDTHH:mm:ss.SSSZ'),
position: { tiebreaker, time: moment(timestamp).toISOString() },
position: { tiebreaker, time },
start: moment(timeRange.startTime).format('YYYY-MM-DDTHH:mm:ss.SSSZ'),
streamLive: false,
}),
Expand All @@ -79,7 +81,7 @@ export const CategoryExampleMessage: React.FunctionComponent<{
onMouseLeave={setNotHovered}
>
<LogEntryColumn {...columnWidths[timestampColumnId]}>
<LogEntryTimestampColumn format={exampleTimestampFormat} time={timestamp} />
<LogEntryTimestampColumn format={exampleTimestampFormat} time={time} />
</LogEntryColumn>
<LogEntryColumn {...columnWidths[messageColumnId]}>
<LogEntryMessageColumn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,15 @@ export const LogEntryExampleMessage: React.FunctionComponent<Props> = ({
// handle special cases for the dataset value
const humanFriendlyDataset = getFriendlyNameForPartitionId(dataset);

const time = moment(timestamp).toISOString();

const viewInStreamLinkProps = useLinkProps({
app: 'logs',
pathname: 'stream',
search: {
logPosition: encode({
end: moment(timeRange.endTime).format('YYYY-MM-DDTHH:mm:ss.SSSZ'),
position: { tiebreaker, time: moment(timestamp).toISOString() },
position: { tiebreaker, time },
start: moment(timeRange.startTime).format('YYYY-MM-DDTHH:mm:ss.SSSZ'),
streamLive: false,
}),
Expand Down Expand Up @@ -182,7 +184,7 @@ export const LogEntryExampleMessage: React.FunctionComponent<Props> = ({
onMouseLeave={setItemIsNotHovered}
>
<LogEntryColumn {...columnWidths[timestampColumnId]}>
<LogEntryTimestampColumn format={exampleTimestampFormat} time={timestamp} />
<LogEntryTimestampColumn format={exampleTimestampFormat} time={time} />
</LogEntryColumn>
<LogEntryColumn {...columnWidths[messageColumnId]}>
<LogEntryMessageColumn
Expand Down Expand Up @@ -301,7 +303,10 @@ export const LogEntryExampleMessageHeaders: React.FunctionComponent<{
data-test-subj="logColumnHeader messageLogColumnHeader"
key={columnConfiguration.messageColumn.id}
>
Message
{i18n.translate(
'xpack.infra.logEntryExampleMessageHeaders.logColumnHeader.messageLabel',
{ defaultMessage: 'Message' }
)}
</LogColumnHeader>
);
} else if (isFieldLogColumnConfiguration(columnConfiguration)) {
Expand Down

0 comments on commit 6c325c5

Please sign in to comment.