Граф коммитов

7 Коммитов

Автор SHA1 Сообщение Дата
sivakami-projects 1eed84ef61
ETW logging implementation in CNI (#2668)
* Add ETW support in zap logger for CNI

Added a zap WriteSyncer to enable direct ETW logging through zap core, maintaining existing logging structure while to ETW from CNI.

* Transform 'zapetw' package into a standalone module for external use

* Revert "Transform 'zapetw' package into a standalone module for external use"

This reverts commit 63050ed68d353e43ae1b1fedd11b8e99259b7a28.

* Relocate EtwWriteSyncer.go to zapetw module for improved organization

- Renamed and moved cni/log/ETWZapCore/EtwWriteSyncer.go to zapetw/write_syncer.go.

* Applied gofumpt formatting to adhere to style guidelines.

* 1. Implemented platform-specific ETW logging enhancements.
2. Refactor ETW initialization into dedicated method and zapetw package.

* Changed InitETWLogger method signature for Linux.

* Wrapped error messages at each level of the call hierarchy.

* Removed punctuation marks from error messages.

* Wrapped error messages with errors.wrap method.

* Added comments for clarity.

* implemented zap.core for ETW.

* Fixed lint issues.

* Catch errors from etw.writeEvent method.

* Renamed provider.

* Abstracted etw core creation in logger_windows.
Removed unsupported error from logger_linux to keep the behaviour uniform.

* renamed unused parameter.

* Renamed variable to lower camel case as it is private. Removed additional local reference.

* fixed variable name.

* Added comment.

* Renamed ETW provider, removed application names from the provider name.

---------

Co-authored-by: Sivakami Subramaniam <t-sivakamis@microsoft.com>
2024-04-18 18:17:18 +00:00
Paul Yu 246fee4bd0
[CNI] restruct CNI logger (#2226)
* small change for zap log restruct
2023-09-19 23:02:28 +00:00
Paul Yu 44dc74e5ec
[CNI] Migrate network and platform package logging to zap (#2209)
* network package zap logger

* add zaplogger for platform
2023-09-16 00:14:44 +00:00
Paul Yu a90a77e0fe
restruct zap logger for CNI (#2184)
* restruct zap logger
2023-09-08 18:36:19 +00:00
Paul Yu 0f835df0a4
zap: change cni component structure (#2143)
* change cni component structure

* fix component name

* add pid back

* add pid back
2023-08-15 19:50:58 -04:00
Paul Yu 590b036e7d
chore: log process id instead of logging name (#2100)
* get rid of logger name

* change to getpid()

* fix comment
2023-08-12 03:47:07 +00:00
estebancams 04566d5fca
implement zap for cni (#1933)
* feat: added logger package and replaced old log initialization for the new one

* feat: changed all log lines to new zap logger

* fix: typo

* Update azure-ipam/logger/logger.go

Co-authored-by: Timothy J. Raymond <timraymond@users.noreply.github.com>

* fix: adding constants to describe logger rotations constraints

* Renamed logger New method

* Replaced logAndSend method by log 1st and send then so we can use zap fields

* minor fixes

* added logger init for tests

* replaced Any by Error

* gci ipam_test

* fixed govet errors

* moved component to a zap field

* fixed linit issues

* added log mock

* fix: gci

* fix: added context for logger teardown

* Update cni/log/logger.go

Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>

* moved logger init mock function

* fix: lint findings

---------

Co-authored-by: Esteban Capillo <estebancams@microsoft.com>
Co-authored-by: Timothy J. Raymond <timraymond@users.noreply.github.com>
Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>
2023-07-03 12:01:47 -07:00