Skip to content

Add log_format and log_date_format to pytest.ini for improved logging…#19965

Merged
roy-sror merged 1 commit intosonic-net:masterfrom
xixuej:pytest_log_format
Aug 11, 2025
Merged

Add log_format and log_date_format to pytest.ini for improved logging…#19965
roy-sror merged 1 commit intosonic-net:masterfrom
xixuej:pytest_log_format

Conversation

@xixuej
Copy link
Copy Markdown
Contributor

@xixuej xixuej commented Jul 31, 2025

Currently we have logging logs attached to allure report but these logs do not have date and time information and it makes debugging difficult when we need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will be attached to allure report

Description of PR

Summary: customize pytest logging format for the log messages contained in allure report
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Approach

Customize pytest logging format for allure report

What is the motivation for this PR?

Previously we don't have date and time information in the logs attached in allure report, this makes trouble shooting difficult, specially the failures that are time-sensitive

How did you do it?

add the log format customization in pytest configuration file

How did you verify/test it?

run a simple test to verify the log format in allure report is exactly the same as the format I defined in the pytest configuration file

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

… configuration

Currently we have logging logs attached to allure report but these logs do not
have date and time information and it makes debugging difficult when we
need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will
be attached to allure report
@xixuej xixuej requested review from a team and wangxin as code owners July 31, 2025 10:04
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@nhe-NV
Copy link
Copy Markdown
Contributor

nhe-NV commented Aug 3, 2025

@wangxin Can you help to review?

@xixuej
Copy link
Copy Markdown
Contributor Author

xixuej commented Aug 4, 2025

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

@roy-sror roy-sror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls fix the commit message

@roy-sror roy-sror merged commit 5649ef1 into sonic-net:master Aug 11, 2025
20 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Aug 12, 2025
… configuration (sonic-net#19965)

Currently we have logging logs attached to allure report but these logs do not
have date and time information and it makes debugging difficult when we
need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will
be attached to allure report
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202505: #20209

mssonicbld pushed a commit that referenced this pull request Aug 12, 2025
… configuration (#19965)

Currently we have logging logs attached to allure report but these logs do not
have date and time information and it makes debugging difficult when we
need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will
be attached to allure report
ashutosh-agrawal pushed a commit to ashutosh-agrawal/sonic-mgmt that referenced this pull request Aug 14, 2025
… configuration (sonic-net#19965)

Currently we have logging logs attached to allure report but these logs do not
have date and time information and it makes debugging difficult when we
need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will
be attached to allure report
vidyac86 pushed a commit to vidyac86/sonic-mgmt that referenced this pull request Oct 23, 2025
… configuration (sonic-net#19965)

Currently we have logging logs attached to allure report but these logs do not
have date and time information and it makes debugging difficult when we
need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will
be attached to allure report
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
… configuration (sonic-net#19965)

Currently we have logging logs attached to allure report but these logs do not
have date and time information and it makes debugging difficult when we
need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will
be attached to allure report

Signed-off-by: opcoder0 <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 16, 2025
… configuration (sonic-net#19965)

Currently we have logging logs attached to allure report but these logs do not
have date and time information and it makes debugging difficult when we
need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will
be attached to allure report

Signed-off-by: Guy Shemesh <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
… configuration (sonic-net#19965)

Currently we have logging logs attached to allure report but these logs do not
have date and time information and it makes debugging difficult when we
need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will
be attached to allure report

Signed-off-by: Aharon Malkin <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
… configuration (sonic-net#19965)

Currently we have logging logs attached to allure report but these logs do not
have date and time information and it makes debugging difficult when we
need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will
be attached to allure report

Signed-off-by: Guy Shemesh <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Jan 13, 2026
… configuration (sonic-net#19965)

Currently we have logging logs attached to allure report but these logs do not
have date and time information and it makes debugging difficult when we
need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will
be attached to allure report
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
… configuration (sonic-net#19965)

Currently we have logging logs attached to allure report but these logs do not
have date and time information and it makes debugging difficult when we
need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will
be attached to allure report

Signed-off-by: Guy Shemesh <[email protected]>
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Feb 2, 2026
… configuration (sonic-net#19965)

Currently we have logging logs attached to allure report but these logs do not
have date and time information and it makes debugging difficult when we
need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will
be attached to allure report

Signed-off-by: Yael Tzur <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Mar 27, 2026
… configuration (sonic-net#19965)

Currently we have logging logs attached to allure report but these logs do not
have date and time information and it makes debugging difficult when we
need to align the date and time logs from allure with other logs.

This change is to add customized format for the log messages that will
be attached to allure report
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants