Repository: corazawaf/coraza
Pull request #687 (2023-03-05 21:51:36)

chore: reallocate loggers
Closes https://github.com/corazawaf/coraza/issues/633

codecov[bot]: # [Codecov](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf) Report
Patch coverage: **`94.59`**% and no project coverage change
> Comparison is base [(`b91d392`)](https://codecov.io/gh/corazawaf/coraza/commit/b91d392ebebcb0f1d5f9592e64ccf25a7e8572c5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf) 80.85% compared to head [(`b1add4d`)](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf) 80.85%.

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##           v3/dev     #687   +/-   ##
=======================================
  Coverage   80.85%   80.85%           
=======================================
  Files         146      146           
  Lines        7986     7986           
=======================================
  Hits         6457     6457           
  Misses       1303     1303           
  Partials      226      226           
```

| Flag | Coverage Δ | |
|---|---|---|
| default | `76.91% <97.14%> (ø)` | |
| examples | `27.17% <51.42%> (ø)` | |
| ftw | `50.47% <17.14%> (ø)` | |
| ftw-multiphase | `50.56% <17.14%> (ø)` | |
| tinygo | `75.89% <85.18%> (ø)` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf) | Coverage Δ | |
|---|---|---|
| [auditlog/init.go](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf#diff-YXVkaXRsb2cvaW5pdC5nbw==) | `100.00% <ø> (ø)` | |
| [auditlog/init\_tinygo.go](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf#diff-YXVkaXRsb2cvaW5pdF90aW55Z28uZ28=) | `100.00% <ø> (ø)` | |
| [auditlog/noop\_formater.go](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf#diff-YXVkaXRsb2cvbm9vcF9mb3JtYXRlci5nbw==) | `0.00% <0.00%> (ø)` | |
| [debuglog/default.go](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf#diff-ZGVidWdsb2cvZGVmYXVsdC5nbw==) | `100.00% <ø> (ø)` | |
| [debuglog/level.go](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf#diff-ZGVidWdsb2cvbGV2ZWwuZ28=) | `100.00% <ø> (ø)` | |
| [debuglog/logger.go](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf#diff-ZGVidWdsb2cvbG9nZ2VyLmdv) | `100.00% <ø> (ø)` | |
| [debuglog/nop.go](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf#diff-ZGVidWdsb2cvbm9wLmdv) | `72.72% <ø> (ø)` | |
| [types/waf.go](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf#diff-dHlwZXMvd2FmLmdv) | `97.05% <ø> (ø)` | |
| [internal/corazawaf/transaction.go](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf#diff-aW50ZXJuYWwvY29yYXphd2FmL3RyYW5zYWN0aW9uLmdv) | `78.54% <92.30%> (ø)` | |
| [actions/ctl.go](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf#diff-YWN0aW9ucy9jdGwuZ28=) | `84.12% <100.00%> (ø)` | |
| ... and [9 more](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf) | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf)

</details>

[:umbrella: View full report at Codecov](https://codecov.io/gh/corazawaf/coraza/pull/687?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf).

sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=coraza&pullRequest=687)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=687&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=687&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=coraza&pullRequest=687&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=687&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=687&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=coraza&pullRequest=687&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=687&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=687&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=687&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=687&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=687&resolved=false&types=CODE_SMELL) [100 Code Smells](https://sonarcloud.io/project/issues?id=coraza&pullRequest=687&resolved=false&types=CODE_SMELL)

[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=687&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=coraza&pullRequest=687&metric=new_coverage&view=list)  
[![0.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.1%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=687&metric=new_duplicated_lines_density&view=list) [0.1% Duplication](https://sonarcloud.io/component_measures?id=coraza&pullRequest=687&metric=new_duplicated_lines_density&view=list)



Patch:
diff --git a/actions/ctl.go b/actions/ctl.go
index 2d89f0d..3bbd8c2 100644
--- a/actions/ctl.go
+++ b/actions/ctl.go
@@ -10,7 +10,7 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/corazawaf/coraza/v3/debuglogger"
+	"github.com/corazawaf/coraza/v3/debuglog"
 	"github.com/corazawaf/coraza/v3/internal/corazawaf"
 	utils "github.com/corazawaf/coraza/v3/internal/strings"
 	"github.com/corazawaf/coraza/v3/rules"
@@ -209,7 +209,7 @@ func (a *ctlFn) Evaluate(_ rules.RuleMetadata, txS rules.TransactionState) {
 			return
 		}
 
-		tx.SetDebugLogLevel(debuglogger.LogLevel(lvl))
+		tx.SetDebugLogLevel(debuglog.LogLevel(lvl))
 	}
 }
 
diff --git a/loggers/README.md b/auditlog/README.md
similarity index 100%
rename from loggers/README.md
rename to auditlog/README.md
diff --git a/loggers/auditlog.go b/auditlog/auditlog.go
similarity index 53%
rename from loggers/auditlog.go
rename to auditlog/auditlog.go
index 586e06f..4311c5c 100644
--- a/loggers/auditlog.go
+++ b/auditlog/auditlog.go
@@ -1,27 +1,27 @@
 // Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
 // SPDX-License-Identifier: Apache-2.0
 
-package loggers
+package auditlog
 
 import (
 	"github.com/corazawaf/coraza/v3/types"
 )
 
-// AuditLog represents the main struct for audit log data
-type AuditLog struct {
+// Log represents the main struct for audit log data
+type Log struct {
 	// Parts contains the parts of the audit log
 	Parts types.AuditLogParts `json:"-"`
 
 	// Transaction contains the transaction information
-	Transaction AuditTransaction `json:"transaction"`
+	Transaction Transaction `json:"transaction"`
 
 	// Messages contains the triggered rules information
-	Messages []AuditMessage `json:"messages"`
+	Messages []Message `json:"messages"`
 }
 
-// AuditTransaction contains transaction specific
+// Transaction contains transaction specific
 // information
-type AuditTransaction struct {
+type Transaction struct {
 	// Timestamp "02/Jan/2006:15:04:20 -0700" format
 	Timestamp     string `json:"timestamp"`
 	UnixTimestamp int64  `json:"unix_timestamp"`
@@ -32,27 +32,27 @@ type AuditTransaction struct {
 	// Client IP Address string representation
 	ClientIP string `json:"client_ip"`
 
-	ClientPort int                      `json:"client_port"`
-	HostIP     string                   `json:"host_ip"`
-	HostPort   int                      `json:"host_port"`
-	ServerID   string                   `json:"server_id"`
-	Request    AuditTransactionRequest  `json:"request"`
-	Response   AuditTransactionResponse `json:"response"`
-	Producer   AuditTransactionProducer `json:"producer"`
+	ClientPort int                 `json:"client_port"`
+	HostIP     string              `json:"host_ip"`
+	HostPort   int                 `json:"host_port"`
+	ServerID   string              `json:"server_id"`
+	Request    TransactionRequest  `json:"request"`
+	Response   TransactionResponse `json:"response"`
+	Producer   TransactionProducer `json:"producer"`
 }
 
-// AuditTransactionResponse contains response specific
+// TransactionResponse contains response specific
 // information
-type AuditTransactionResponse struct {
+type TransactionResponse struct {
 	Protocol string              `json:"protocol"`
 	Status   int                 `json:"status"`
 	Headers  map[string][]string `json:"headers"`
 	Body     string              `json:"body"`
 }
 
-// AuditTransactionProducer contains producer specific
+// TransactionProducer contains producer specific
 // information for debugging
-type AuditTransactionProducer struct {
+type TransactionProducer struct {
 	Connector  string   `json:"connector"`
 	Version    string   `json:"version"`
 	Server     string   `json:"server"`
@@ -61,37 +61,37 @@ type AuditTransactionProducer struct {
 	Rulesets   []string `json:"rulesets"`
 }
 
-// AuditTransactionRequest contains request specific
+// TransactionRequest contains request specific
 // information
-type AuditTransactionRequest struct {
-	Method      string                         `json:"method"`
-	Protocol    string                         `json:"protocol"`
-	URI         string                         `json:"uri"`
-	HTTPVersion string                         `json:"http_version"`
-	Headers     map[string][]string            `json:"headers"`
-	Body        string                         `json:"body"`
-	Files       []AuditTransactionRequestFiles `json:"files"`
+type TransactionRequest struct {
+	Method      string                    `json:"method"`
+	Protocol    string                    `json:"protocol"`
+	URI         string                    `json:"uri"`
+	HTTPVersion string                    `json:"http_version"`
+	Headers     map[string][]string       `json:"headers"`
+	Body        string                    `json:"body"`
+	Files       []TransactionRequestFiles `json:"files"`
 }
 
-// AuditTransactionRequestFiles contains information
+// TransactionRequestFiles contains information
 // for the uploaded files using multipart forms
-type AuditTransactionRequestFiles struct {
+type TransactionRequestFiles struct {
 	Name string `json:"name"`
 	Size int64  `json:"size"`
 	Mime string `json:"mime"`
 }
 
-// AuditMessage contains information about the triggered
+// Message contains information about the triggered
 // rules
-type AuditMessage struct {
-	Actionset string           `json:"actionset"`
-	Message   string           `json:"message"`
-	Data      AuditMessageData `json:"data"`
+type Message struct {
+	Actionset string      `json:"actionset"`
+	Message   string      `json:"message"`
+	Data      MessageData `json:"data"`
 }
 
-// AuditMessageData contains information about the triggered
+// MessageData contains information about the triggered
 // rules in detail
-type AuditMessageData struct {
+type MessageData struct {
 	File     string             `json:"file"`
 	Line     int                `json:"line"`
 	ID       int                `json:"id"`
@@ -109,24 +109,24 @@ type AuditMessageData struct {
 // LEGACY FORMAT
 
 // Main struct for audit log data
-type auditLogLegacy struct {
+type logLegacy struct {
 	// Section A
-	Transaction auditLogLegacyTransaction `json:"transaction"`
+	Transaction logLegacyTransaction `json:"transaction"`
 
 	// Section B or C
-	Request auditLogLegacyRequest `json:"request"`
+	Request logLegacyRequest `json:"request"`
 
 	// Section J (File Uploads)
 	// TBI
 
 	// Section E and F
-	Response auditLogLegacyResponse `json:"response"`
+	Response logLegacyResponse `json:"response"`
 
 	// Section H
-	AuditData auditLogLegacyData `json:"audit_data"`
+	AuditData logLegacyData `json:"audit_data"`
 }
 
-type auditLogLegacyTransaction struct {
+type logLegacyTransaction struct {
 	// Time format 03/Dec/2021:01:13:44.468137 +0000
 	Time          string `json:"time"`
 	TransactionID string `json:"transaction_id"`
@@ -136,31 +136,31 @@ type auditLogLegacyTransaction struct {
 	LocalPort     int    `json:"local_port"`
 }
 
-type auditLogLegacyRequest struct {
+type logLegacyRequest struct {
 	RequestLine string `json:"request_line"`
 	// Headers should be a map of slices but in this case they are
 	// joined by comma (,)
 	Headers map[string]string `json:"headers"`
 }
 
-type auditLogLegacyResponse struct {
+type logLegacyResponse struct {
 	Status   int               `json:"status"`
 	Protocol string            `json:"protocol"`
 	Headers  map[string]string `json:"headers"`
 }
 
-type auditLogLegacyData struct {
-	Messages              []string                `json:"messages"`
-	ErrorMessages         []string                `json:"error_messages"`
-	Handler               string                  `json:"handler"`
-	Stopwatch             auditLogLegacyStopwatch `json:"stopwatch"`
-	ResponseBodyDechunked bool                    `json:"response_body_dechunked"`
-	Producer              []string                `json:"producer"`
-	Server                string                  `json:"server"`
-	EngineMode            string                  `json:"engine_mode"`
+type logLegacyData struct {
+	Messages              []string           `json:"messages"`
+	ErrorMessages         []string           `json:"error_messages"`
+	Handler               string             `json:"handler"`
+	Stopwatch             logLegacyStopwatch `json:"stopwatch"`
+	ResponseBodyDechunked bool               `json:"response_body_dechunked"`
+	Producer              []string           `json:"producer"`
+	Server                string             `json:"server"`
+	EngineMode            string             `json:"engine_mode"`
 }
 
-type auditLogLegacyStopwatch struct {
+type logLegacyStopwatch struct {
 	Combined int64 // Combined processing time
 	P1       int64 // Processing time for the Request Headers phase
 	P2       int64 // Processing time for the Request Body phase
diff --git a/loggers/concurrent_writer.go b/auditlog/concurrent_writer.go
similarity index 97%
rename from loggers/concurrent_writer.go
rename to auditlog/concurrent_writer.go
index e4e20c8..2730944 100644
--- a/loggers/concurrent_writer.go
+++ b/auditlog/concurrent_writer.go
@@ -4,7 +4,7 @@
 //go:build !tinygo
 // +build !tinygo
 
-package loggers
+package auditlog
 
 import (
 	"fmt"
@@ -51,7 +51,7 @@ func (cl *concurrentWriter) Init(c types.Config) error {
 	return nil
 }
 
-func (cl concurrentWriter) Write(al *AuditLog) error {
+func (cl concurrentWriter) Write(al *Log) error {
 	// 192.168.3.130 192.168.3.1 - - [22/Aug/2009:13:24:20 +0100] "GET / HTTP/1.1" 200 56 "-" "-" SojdH8AAQEAAAugAQAAAAAA "-" /20090822/20090822-1324/20090822-132420-SojdH8AAQEAAAugAQAAAAAA 0 1248
 	t := time.Unix(0, al.Transaction.UnixTimestamp)
 
diff --git a/loggers/formats.go b/auditlog/formats.go
similarity index 94%
rename from loggers/formats.go
rename to auditlog/formats.go
index e877f04..9381bbd 100644
--- a/loggers/formats.go
+++ b/auditlog/formats.go
@@ -1,7 +1,7 @@
 // Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
 // SPDX-License-Identifier: Apache-2.0
 
-// Package loggers implements a set of log formatters and writers
+// Package auditlog implements a set of log formatters and writers
 // for audit logging.
 //
 // The following log formats are supported:
@@ -17,7 +17,7 @@
 //
 // More writers and formatters can be registered using the RegisterWriter and
 // RegisterFormatter functions.
-package loggers
+package auditlog
 
 import (
 	"fmt"
@@ -25,7 +25,7 @@ import (
 	utils "github.com/corazawaf/coraza/v3/internal/strings"
 )
 
-func nativeFormatter(al *AuditLog) ([]byte, error) {
+func nativeFormatter(al *Log) ([]byte, error) {
 	boundary := utils.RandomString(10)
 	parts := map[byte]string{}
 	// [27/Jul/2016:05:46:16 +0200] V5guiH8AAQEAADTeJ2wAAAAK 192.168.3.1 50084 192.168.3.111 80
diff --git a/loggers/formats_json.go b/auditlog/formats_json.go
similarity index 81%
rename from loggers/formats_json.go
rename to auditlog/formats_json.go
index b42b8c2..3d0bec6 100644
--- a/loggers/formats_json.go
+++ b/auditlog/formats_json.go
@@ -1,11 +1,11 @@
 // Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
 // SPDX-License-Identifier: Apache-2.0
 
-// JSON loggers not supported on TinyGo yet.
+// JSON auditlog not supported on TinyGo yet.
 //go:build !tinygo
 // +build !tinygo
 
-package loggers
+package auditlog
 
 import (
 	"encoding/json"
@@ -14,7 +14,7 @@ import (
 )
 
 // Coraza format
-func jsonFormatter(al *AuditLog) ([]byte, error) {
+func jsonFormatter(al *Log) ([]byte, error) {
 	jsdata, err := json.Marshal(al)
 	if err != nil {
 		return nil, err
@@ -23,7 +23,7 @@ func jsonFormatter(al *AuditLog) ([]byte, error) {
 }
 
 // Coraza legacy json format
-func legacyJSONFormatter(al *AuditLog) ([]byte, error) {
+func legacyJSONFormatter(al *Log) ([]byte, error) {
 	reqHeaders := map[string]string{}
 	for k, v := range al.Transaction.Request.Headers {
 		reqHeaders[k] = strings.Join(v, ", ")
@@ -41,8 +41,8 @@ func legacyJSONFormatter(al *AuditLog) ([]byte, error) {
 		producers = append(producers, conn)
 	}
 	producers = append(producers, al.Transaction.Producer.Rulesets...)
-	al2 := auditLogLegacy{
-		Transaction: auditLogLegacyTransaction{
+	al2 := logLegacy{
+		Transaction: logLegacyTransaction{
 			Time:          al.Transaction.Timestamp,
 			TransactionID: al.Transaction.ID,
 			RemoteAddress: al.Transaction.ClientIP,
@@ -50,17 +50,17 @@ func legacyJSONFormatter(al *AuditLog) ([]byte, error) {
 			LocalAddress:  al.Transaction.HostIP,
 			LocalPort:     al.Transaction.HostPort,
 		},
-		Request: auditLogLegacyRequest{
+		Request: logLegacyRequest{
 			RequestLine: fmt.Sprintf("%s %s %s", al.Transaction.Request.Method, al.Transaction.Request.URI, al.Transaction.Request.HTTPVersion),
 			Headers:     reqHeaders,
 		},
-		Response: auditLogLegacyResponse{
+		Response: logLegacyResponse{
 			Status:   al.Transaction.Response.Status,
 			Protocol: al.Transaction.Response.Protocol,
 			Headers:  resHeaders,
 		},
-		AuditData: auditLogLegacyData{
-			Stopwatch:  auditLogLegacyStopwatch{},
+		AuditData: logLegacyData{
+			Stopwatch:  logLegacyStopwatch{},
 			Messages:   messages,
 			Producer:   producers,
 			EngineMode: al.Transaction.Producer.RuleEngine,
diff --git a/loggers/init.go b/auditlog/init.go
similarity index 96%
rename from loggers/init.go
rename to auditlog/init.go
index b2abde8..fdbcd23 100644
--- a/loggers/init.go
+++ b/auditlog/init.go
@@ -4,7 +4,7 @@
 //go:build !tinygo
 // +build !tinygo
 
-package loggers
+package auditlog
 
 func init() {
 	RegisterLogWriter("concurrent", func() LogWriter {
diff --git a/loggers/init_tinygo.go b/auditlog/init_tinygo.go
similarity index 96%
rename from loggers/init_tinygo.go
rename to auditlog/init_tinygo.go
index 243c820..1751f66 100644
--- a/loggers/init_tinygo.go
+++ b/auditlog/init_tinygo.go
@@ -4,7 +4,7 @@
 //go:build tinygo
 // +build tinygo
 
-package loggers
+package auditlog
 
 func init() {
 	RegisterLogWriter("concurrent", func() LogWriter {
diff --git a/loggers/logger.go b/auditlog/logger.go
similarity index 91%
rename from loggers/logger.go
rename to auditlog/logger.go
index 204dfe8..9f5a83e 100644
--- a/loggers/logger.go
+++ b/auditlog/logger.go
@@ -1,7 +1,7 @@
 // Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
 // SPDX-License-Identifier: Apache-2.0
 
-package loggers
+package auditlog
 
 import (
 	"fmt"
@@ -12,7 +12,7 @@ import (
 
 // LogFormatter is the interface for all log formatters
 // A LogFormatter receives an auditlog and generates "readable" audit log
-type LogFormatter = func(al *AuditLog) ([]byte, error)
+type LogFormatter = func(al *Log) ([]byte, error)
 
 // LogWriter is the interface for all log writers
 // A LogWriter receives an auditlog and writes it to the output stream
@@ -24,7 +24,7 @@ type LogWriter interface {
 	// Using the LogFormatter is mandatory to generate a "readable" audit log
 	// It is not sent as a bslice because some writers may require some Audit
 	// metadata.
-	Write(*AuditLog) error
+	Write(*Log) error
 	// Close the writer if required
 	Close() error
 }
@@ -52,7 +52,7 @@ func GetLogWriter(name string) (LogWriter, error) {
 
 // RegisterLogFormatter registers a new logger format
 // it can be used for plugins
-func RegisterLogFormatter(name string, f func(al *AuditLog) ([]byte, error)) {
+func RegisterLogFormatter(name string, f func(al *Log) ([]byte, error)) {
 	formatters[name] = f
 }
 
diff --git a/loggers/noop_formater.go b/auditlog/noop_formater.go
similarity index 75%
rename from loggers/noop_formater.go
rename to auditlog/noop_formater.go
index 303b0c4..a3a638c 100644
--- a/loggers/noop_formater.go
+++ b/auditlog/noop_formater.go
@@ -5,8 +5,8 @@
 //go:build tinygo
 // +build tinygo
 
-package loggers
+package auditlog
 
-func noopFormater(al *AuditLog) ([]byte, error) {
+func noopFormater(al *Log) ([]byte, error) {
 	return nil, nil
 }
diff --git a/loggers/noop_writer.go b/auditlog/noop_writer.go
similarity index 86%
rename from loggers/noop_writer.go
rename to auditlog/noop_writer.go
index 6ef4b8c..50017ec 100644
--- a/loggers/noop_writer.go
+++ b/auditlog/noop_writer.go
@@ -5,7 +5,7 @@
 //go:build tinygo
 // +build tinygo
 
-package loggers
+package auditlog
 
 import (
 	"github.com/corazawaf/coraza/v3/types"
@@ -15,7 +15,7 @@ import (
 type noopWriter struct{}
 
 func (noopWriter) Init(types.Config) error { return nil }
-func (noopWriter) Write(*AuditLog) error   { return nil }
+func (noopWriter) Write(*Log) error        { return nil }
 func (noopWriter) Close() error            { return nil }
 
 var _ LogWriter = (*noopWriter)(nil)
diff --git a/loggers/serial_writer.go b/auditlog/serial_writer.go
similarity index 94%
rename from loggers/serial_writer.go
rename to auditlog/serial_writer.go
index 4cbeac4..cce9202 100644
--- a/loggers/serial_writer.go
+++ b/auditlog/serial_writer.go
@@ -4,7 +4,7 @@
 //go:build !tinygo
 // +build !tinygo
 
-package loggers
+package auditlog
 
 import (
 	"io"
@@ -44,7 +44,7 @@ func (sl *serialWriter) Init(c types.Config) error {
 	return nil
 }
 
-func (sl *serialWriter) Write(al *AuditLog) error {
+func (sl *serialWriter) Write(al *Log) error {
 	if sl.formatter == nil {
 		return nil
 	}
diff --git a/config.go b/config.go
index 9e3a8c1..9a707c0 100644
--- a/config.go
+++ b/config.go
@@ -6,9 +6,9 @@ package coraza
 import (
 	"io/fs"
 
-	"github.com/corazawaf/coraza/v3/debuglogger"
+	"github.com/corazawaf/coraza/v3/auditlog"
+	"github.com/corazawaf/coraza/v3/debuglog"
 	"github.com/corazawaf/coraza/v3/internal/corazawaf"
-	"github.com/corazawaf/coraza/v3/loggers"
 	"github.com/corazawaf/coraza/v3/types"
 )
 
@@ -57,7 +57,7 @@ type WAFConfig interface {
 	WithResponseBodyMimeTypes(mimeTypes []string) WAFConfig
 
 	// WithDebugLogger configures a debug logger.
-	WithDebugLogger(logger debuglogger.Logger) WAFConfig
+	WithDebugLogger(logger debuglog.Logger) WAFConfig
 
 	// WithErrorCallback configures an error callback that can be used
 	// to log errors triggered by the WAF.
@@ -81,8 +81,8 @@ type AuditLogConfig interface {
 	// WithParts configures the parts of the request/response to be logged.
 	WithParts(parts types.AuditLogParts) AuditLogConfig
 
-	// WithLogger configures the loggers.LogWriter to write logs to.
-	WithLogger(logger loggers.LogWriter) AuditLogConfig
+	// WithLogger configures the auditlog.LogWriter to write logs to.
+	WithLogger(logger auditlog.LogWriter) AuditLogConfig
 }
 
 // NewAuditLogConfig returns a new AuditLogConfig with the default settings.
@@ -108,7 +108,7 @@ type wafConfig struct {
 	responseBodyAccess       bool
 	responseBodyLimit        *int
 	responseBodyMimeTypes    []string
-	debugLogger              debuglogger.Logger
+	debugLogger              debuglog.Logger
 	errorCallback            func(rule types.MatchedRule)
 	fsRoot                   fs.FS
 }
@@ -155,7 +155,7 @@ func (c *wafConfig) WithResponseBodyAccess() WAFConfig {
 	return ret
 }
 
-func (c *wafConfig) WithDebugLogger(logger debuglogger.Logger) WAFConfig {
+func (c *wafConfig) WithDebugLogger(logger debuglog.Logger) WAFConfig {
 	ret := c.clone()
 	ret.debugLogger = logger
 	return ret
@@ -208,7 +208,7 @@ func (c *wafConfig) WithResponseBodyMimeTypes(mimeTypes []string) WAFConfig {
 type auditLogConfig struct {
 	relevantOnly bool
 	parts        types.AuditLogParts
-	logger       loggers.LogWriter
+	logger       auditlog.LogWriter
 }
 
 func (c *auditLogConfig) LogRelevantOnly() AuditLogConfig {
@@ -223,7 +223,7 @@ func (c *auditLogConfig) WithParts(parts types.AuditLogParts) AuditLogConfig {
 	return ret
 }
 
-func (c *auditLogConfig) WithLogger(logger loggers.LogWriter) AuditLogConfig {
+func (c *auditLogConfig) WithLogger(logger auditlog.LogWriter) AuditLogConfig {
 	ret := c.clone()
 	ret.logger = logger
 	return ret
diff --git a/debuglogger/default.go b/debuglog/default.go
similarity index 99%
rename from debuglogger/default.go
rename to debuglog/default.go
index 18c9628..3acfad1 100644
--- a/debuglogger/default.go
+++ b/debuglog/default.go
@@ -1,7 +1,7 @@
 // Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
 // SPDX-License-Identifier: Apache-2.0
 
-package debuglogger
+package debuglog
 
 import (
 	"fmt"
diff --git a/debuglogger/level.go b/debuglog/level.go
similarity index 98%
rename from debuglogger/level.go
rename to debuglog/level.go
index 357642f..52d8c4a 100644
--- a/debuglogger/level.go
+++ b/debuglog/level.go
@@ -1,7 +1,7 @@
 // Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
 // SPDX-License-Identifier: Apache-2.0
 
-package debuglogger
+package debuglog
 
 // LogLevel is the type of log level
 type LogLevel int8
diff --git a/debuglogger/logger.go b/debuglog/logger.go
similarity index 99%
rename from debuglogger/logger.go
rename to debuglog/logger.go
index 8863da8..bdac47a 100644
--- a/debuglogger/logger.go
+++ b/debuglog/logger.go
@@ -1,7 +1,7 @@
 // Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
 // SPDX-License-Identifier: Apache-2.0
 
-package debuglogger
+package debuglog
 
 import (
 	"fmt"
diff --git a/debuglogger/nop.go b/debuglog/nop.go
similarity index 97%
rename from debuglogger/nop.go
rename to debuglog/nop.go
index 16f49a7..8220ea1 100644
--- a/debuglogger/nop.go
+++ b/debuglog/nop.go
@@ -1,7 +1,7 @@
 // Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
 // SPDX-License-Identifier: Apache-2.0
 
-package debuglogger
+package debuglog
 
 import (
 	"fmt"
diff --git a/internal/corazawaf/transaction.go b/internal/corazawaf/transaction.go
index 1cb10c1..bfef2f7 100644
--- a/internal/corazawaf/transaction.go
+++ b/internal/corazawaf/transaction.go
@@ -16,15 +16,15 @@ import (
 	"strings"
 	"time"
 
+	"github.com/corazawaf/coraza/v3/auditlog"
 	"github.com/corazawaf/coraza/v3/bodyprocessors"
 	"github.com/corazawaf/coraza/v3/collection"
-	"github.com/corazawaf/coraza/v3/debuglogger"
+	"github.com/corazawaf/coraza/v3/debuglog"
 	"github.com/corazawaf/coraza/v3/internal/collections"
 	"github.com/corazawaf/coraza/v3/internal/corazarules"
-	corazatypes "github.com/corazawaf/coraza/v3/internal/corazatypes"
+	"github.com/corazawaf/coraza/v3/internal/corazatypes"
 	stringsutil "github.com/corazawaf/coraza/v3/internal/strings"
 	urlutil "github.com/corazawaf/coraza/v3/internal/url"
-	"github.com/corazawaf/coraza/v3/loggers"
 	"github.com/corazawaf/coraza/v3/rules"
 	"github.com/corazawaf/coraza/v3/types"
 	"github.com/corazawaf/coraza/v3/types/variables"
@@ -104,7 +104,7 @@ type Transaction struct {
 	// Contains a WAF instance for the current transaction
 	WAF *WAF
 
-	debugLogger debuglogger.Logger
+	debugLogger debuglog.Logger
 
 	// Timestamp of the request
 	Timestamp int64
@@ -285,11 +285,11 @@ func (tx *Transaction) Interrupt(interruption *types.Interruption) {
 	}
 }
 
-func (tx *Transaction) DebugLogger() debuglogger.Logger {
+func (tx *Transaction) DebugLogger() debuglog.Logger {
 	return tx.debugLogger
 }
 
-func (tx *Transaction) SetDebugLogLevel(lvl debuglogger.LogLevel) {
+func (tx *Transaction) SetDebugLogLevel(lvl debuglog.LogLevel) {
 	tx.debugLogger = tx.debugLogger.WithLevel(lvl)
 }
 
@@ -1261,8 +1261,8 @@ func (tx *Transaction) MatchedRules() []types.MatchedRule {
 }
 
 // AuditLog returns an AuditLog struct, used to write audit logs
-func (tx *Transaction) AuditLog() *loggers.AuditLog {
-	al := &loggers.AuditLog{}
+func (tx *Transaction) AuditLog() *auditlog.Log {
+	al := &auditlog.Log{}
 	al.Messages = nil
 	// YYYY/MM/DD HH:mm:ss
 	ts := time.Unix(0, tx.Timestamp).Format("2006/01/02 15:04:05")
@@ -1270,7 +1270,7 @@ func (tx *Transaction) AuditLog() *loggers.AuditLog {
 	clientPort, _ := strconv.Atoi(tx.variables.remotePort.Get())
 	hostPort, _ := strconv.Atoi(tx.variables.serverPort.Get())
 	status, _ := strconv.Atoi(tx.variables.responseStatus.Get())
-	al.Transaction = loggers.AuditTransaction{
+	al.Transaction = auditlog.Transaction{
 		Timestamp:     ts,
 		UnixTimestamp: tx.Timestamp,
 		ID:            tx.id,
@@ -1279,14 +1279,14 @@ func (tx *Transaction) AuditLog() *loggers.AuditLog {
 		HostIP:        tx.variables.serverAddr.Get(),
 		HostPort:      hostPort,
 		ServerID:      tx.variables.serverName.Get(), // TODO check
-		Request: loggers.AuditTransactionRequest{
+		Request: auditlog.TransactionRequest{
 			Method:      tx.variables.requestMethod.Get(),
 			Protocol:    tx.variables.requestProtocol.Get(),
 			URI:         tx.variables.requestURI.Get(),
 			HTTPVersion: tx.variables.requestProtocol.Get(),
 			// Body and headers are audit variables.RequestUriRaws
 		},
-		Response: loggers.AuditTransactionResponse{
+		Response: auditlog.TransactionResponse{
 			Status: status,
 			// body and headers are audit parts
 		},
@@ -1299,7 +1299,7 @@ func (tx *Transaction) AuditLog() *loggers.AuditLog {
 	// al.Transaction.Request.Body = tx.RequestBodyBuffer.String()
 	al.Transaction.Response.Headers = tx.variables.responseHeaders.Data()
 	al.Transaction.Response.Body = tx.variables.responseBody.Get()
-	al.Transaction.Producer = loggers.AuditTransactionProducer{
+	al.Transaction.Producer = auditlog.TransactionProducer{
 		Connector:  tx.WAF.ProducerConnector,
 		Version:    tx.WAF.ProducerConnectorVersion,
 		Server:     "",
@@ -1316,7 +1316,7 @@ func (tx *Transaction) AuditLog() *loggers.AuditLog {
 	* if you don’t want to have (often large) files stored in your audit logs.
 	 */
 	// upload data
-	var files []loggers.AuditTransactionRequestFiles
+	var files []auditlog.TransactionRequestFiles
 	al.Transaction.Request.Files = nil
 	for _, file := range tx.variables.files.Get("") {
 		var size int64
@@ -1325,7 +1325,7 @@ func (tx *Transaction) AuditLog() *loggers.AuditLog {
 			// we ignore the error as it defaults to 0
 		}
 		ext := filepath.Ext(file)
-		at := loggers.AuditTransactionRequestFiles{
+		at := auditlog.TransactionRequestFiles{
 			Size: size,
 			Name: file,
 			Mime: mime.TypeByExtension(ext),
@@ -1333,14 +1333,14 @@ func (tx *Transaction) AuditLog() *loggers.AuditLog {
 		files = append(files, at)
 	}
 	al.Transaction.Request.Files = files
-	var mrs []loggers.AuditMessage
+	var mrs []auditlog.Message
 	for _, mr := range tx.matchedRules {
 		r := mr.Rule()
 		for _, matchData := range mr.MatchedDatas() {
-			mrs = append(mrs, loggers.AuditMessage{
+			mrs = append(mrs, auditlog.Message{
 				Actionset: strings.Join(tx.WAF.ComponentNames, " "),
 				Message:   matchData.Message(),
-				Data: loggers.AuditMessageData{
+				Data: auditlog.MessageData{
 					File:     mr.Rule().File(),
 					Line:     mr.Rule().Line(),
 					ID:       r.ID(),
diff --git a/internal/corazawaf/waf.go b/internal/corazawaf/waf.go
index 31eb955..0784a56 100644
--- a/internal/corazawaf/waf.go
+++ b/internal/corazawaf/waf.go
@@ -14,12 +14,11 @@ import (
 	"strings"
 	"time"
 
-	"github.com/corazawaf/coraza/v3/debuglogger"
+	"github.com/corazawaf/coraza/v3/auditlog"
+	"github.com/corazawaf/coraza/v3/debuglog"
 	"github.com/corazawaf/coraza/v3/internal/environment"
-
 	stringutils "github.com/corazawaf/coraza/v3/internal/strings"
 	"github.com/corazawaf/coraza/v3/internal/sync"
-	"github.com/corazawaf/coraza/v3/loggers"
 	"github.com/corazawaf/coraza/v3/types"
 )
 
@@ -117,12 +116,12 @@ type WAF struct {
 	ProducerConnectorVersion string
 
 	// Used for the debug logger
-	Logger debuglogger.Logger
+	Logger debuglog.Logger
 
 	ErrorLogCb func(rule types.MatchedRule)
 
 	// AuditLogWriter is used to write audit logs
-	AuditLogWriter loggers.LogWriter
+	AuditLogWriter auditlog.LogWriter
 }
 
 // NewTransaction Creates a new initialized transaction for this WAF instance
@@ -166,7 +165,7 @@ func (w *WAF) newTransactionWithID(id string) *Transaction {
 	tx.Capture = false
 	tx.stopWatches = map[types.RulePhase]int64{}
 	tx.WAF = w
-	tx.debugLogger = w.Logger.With(debuglogger.Str("tx_id", tx.id))
+	tx.debugLogger = w.Logger.With(debuglog.Str("tx_id", tx.id))
 	tx.Timestamp = time.Now().UnixNano()
 	tx.audit = false
 
@@ -253,9 +252,9 @@ const _1gb = 1073741824
 
 // NewWAF creates a new WAF instance with default variables
 func NewWAF() *WAF {
-	logger := debuglogger.Nop()
+	logger := debuglog.Nop()
 
-	logWriter, err := loggers.GetLogWriter("serial")
+	logWriter, err := auditlog.GetLogWriter("serial")
 	if err != nil {
 		logger.Error().
 			Err(err).
@@ -288,7 +287,7 @@ func (w *WAF) SetDebugLogOutput(wr io.Writer) {
 }
 
 // SetDebugLogLevel changes the debug level of the WAF instance
-func (w *WAF) SetDebugLogLevel(lvl debuglogger.LogLevel) error {
+func (w *WAF) SetDebugLogLevel(lvl debuglog.LogLevel) error {
 	if !lvl.Valid() {
 		return errors.New("invalid log level")
 	}
diff --git a/internal/seclang/directives.go b/internal/seclang/directives.go
index 95c2950..fd062df 100644
--- a/internal/seclang/directives.go
+++ b/internal/seclang/directives.go
@@ -13,10 +13,10 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/corazawaf/coraza/v3/debuglogger"
+	"github.com/corazawaf/coraza/v3/auditlog"
+	"github.com/corazawaf/coraza/v3/debuglog"
 	"github.com/corazawaf/coraza/v3/internal/corazawaf"
 	utils "github.com/corazawaf/coraza/v3/internal/strings"
-	"github.com/corazawaf/coraza/v3/loggers"
 	"github.com/corazawaf/coraza/v3/types"
 )
 
@@ -587,7 +587,7 @@ func directiveSecAuditLogType(options *DirectiveOptions) error {
 		return errEmptyOptions
 	}
 
-	writer, err := loggers.GetLogWriter(options.Opts)
+	writer, err := auditlog.GetLogWriter(options.Opts)
 	if err != nil {
 		return err
 	}
@@ -607,7 +607,7 @@ func directiveSecAuditLogFormat(options *DirectiveOptions) error {
 		return errEmptyOptions
 	}
 
-	formatter, err := loggers.GetLogFormatter(options.Opts)
+	formatter, err := auditlog.GetLogFormatter(options.Opts)
 	if err != nil {
 		return err
 	}
@@ -909,7 +909,7 @@ func directiveSecDebugLogLevel(options *DirectiveOptions) error {
 	if err != nil {
 		return err
 	}
-	return options.WAF.SetDebugLogLevel(debuglogger.LogLevel(lvl))
+	return options.WAF.SetDebugLogLevel(debuglog.LogLevel(lvl))
 }
 
 func directiveSecRuleUpdateTargetByID(options *DirectiveOptions) error {
diff --git a/rules/transaction.go b/rules/transaction.go
index 04c470e..857bf19 100644
--- a/rules/transaction.go
+++ b/rules/transaction.go
@@ -7,7 +7,7 @@ import (
 	"io"
 
 	"github.com/corazawaf/coraza/v3/collection"
-	"github.com/corazawaf/coraza/v3/debuglogger"
+	"github.com/corazawaf/coraza/v3/debuglog"
 	"github.com/corazawaf/coraza/v3/types"
 	"github.com/corazawaf/coraza/v3/types/variables"
 )
@@ -35,7 +35,7 @@ type TransactionState interface {
 	ReadResponseBodyFrom(io.Reader) (*types.Interruption, int, error)
 
 	// DebugLogger returns the logger for this transaction.
-	DebugLogger() debuglogger.Logger
+	DebugLogger() debuglog.Logger
 
 	// Capturing returns whether the transaction is capturing. CaptureField only works if capturing, this can be used
 	// as an optimization to avoid processing specific to capturing fields.
diff --git a/types/transaction.go b/types/transaction.go
index e927884..4b2a723 100644
--- a/types/transaction.go
+++ b/types/transaction.go
@@ -6,7 +6,7 @@ package types
 import (
 	"io"
 
-	"github.com/corazawaf/coraza/v3/debuglogger"
+	"github.com/corazawaf/coraza/v3/debuglog"
 )
 
 // Transaction is created from a WAF instance to handle web requests and responses,
@@ -189,7 +189,7 @@ type Transaction interface {
 	MatchedRules() []MatchedRule
 
 	// DebugLogger returns the debug logger for this transaction.
-	DebugLogger() debuglogger.Logger
+	DebugLogger() debuglog.Logger
 
 	// ID returns the transaction ID.
 	ID() string
diff --git a/types/waf.go b/types/waf.go
index 7ff46ef..dffc0dc 100644
--- a/types/waf.go
+++ b/types/waf.go
@@ -10,9 +10,9 @@ import (
 
 // Config is used to store the configuration of the WAF
 // Internal configurations are not exported.
-// This is used to connect directives with audit loggers.
+// This is used to connect directives with audit auditlog.
 // A WAF instance will share it's Config object with the
-// audit loggers.
+// audit auditlog.
 type Config map[string]interface{}
 
 // Get returns the configuration value for the given key


Test patch:
diff --git a/actions/ctl_test.go b/actions/ctl_test.go
index c2d711c..4c5ae7e 100644
--- a/actions/ctl_test.go
+++ b/actions/ctl_test.go
@@ -8,7 +8,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/corazawaf/coraza/v3/debuglogger"
+	"github.com/corazawaf/coraza/v3/debuglog"
 	"github.com/corazawaf/coraza/v3/internal/corazarules"
 	"github.com/corazawaf/coraza/v3/internal/corazawaf"
 	"github.com/corazawaf/coraza/v3/types"
@@ -156,7 +156,7 @@ func TestCtl(t *testing.T) {
 		t.Run(testName, func(t *testing.T) {
 			logs := &bytes.Buffer{}
 			waf := corazawaf.NewWAF()
-			waf.Logger = debuglogger.Default().WithOutput(logs)
+			waf.Logger = debuglog.Default().WithOutput(logs)
 			r := corazawaf.NewRule()
 			err := waf.Rules.Add(r)
 			if err != nil {
diff --git a/loggers/concurrent_writer_test.go b/auditlog/concurrent_writer_test.go
similarity index 92%
rename from loggers/concurrent_writer_test.go
rename to auditlog/concurrent_writer_test.go
index 6a26081..aa92afb 100644
--- a/loggers/concurrent_writer_test.go
+++ b/auditlog/concurrent_writer_test.go
@@ -4,7 +4,7 @@
 //go:build !tinygo
 // +build !tinygo
 
-package loggers
+package auditlog
 
 import (
 	"encoding/json"
@@ -59,12 +59,12 @@ func TestConcurrentWriterWrites(t *testing.T) {
 		"auditlog_formatter": jsonFormatter,
 	}
 	ts := time.Now().UnixNano()
-	al := &AuditLog{
-		Transaction: AuditTransaction{
+	al := &Log{
+		Transaction: Transaction{
 			UnixTimestamp: ts,
 			ID:            "123",
-			Request:       AuditTransactionRequest{},
-			Response:      AuditTransactionResponse{},
+			Request:       TransactionRequest{},
+			Response:      TransactionResponse{},
 		},
 	}
 	writer := &concurrentWriter{}
@@ -86,7 +86,7 @@ func TestConcurrentWriterWrites(t *testing.T) {
 		t.Error("failed to create audit file for concurrent logger")
 		return
 	}
-	al2 := &AuditLog{}
+	al2 := &Log{}
 	if json.Unmarshal(data, al2) != nil {
 		t.Error("failed to parse json from concurrent audit log", p)
 	}
diff --git a/loggers/formats_json_test.go b/auditlog/formats_json_test.go
similarity index 93%
rename from loggers/formats_json_test.go
rename to auditlog/formats_json_test.go
index e276764..21eb2dc 100644
--- a/loggers/formats_json_test.go
+++ b/auditlog/formats_json_test.go
@@ -4,7 +4,7 @@
 //go:build !tinygo
 // +build !tinygo
 
-package loggers
+package auditlog
 
 import (
 	"encoding/json"
@@ -15,7 +15,7 @@ import (
 func TestFormatters(t *testing.T) {
 	al := createAuditLog()
 	type tcase struct {
-		AuditLog AuditLog
+		Log Log
 		Output   string
 	}
 	cases := map[string][]tcase{
@@ -30,7 +30,7 @@ func TestFormatters(t *testing.T) {
 			t.Error(err)
 		}
 		for _, c := range cases {
-			if out, err := f(c.AuditLog); err != nil {
+			if out, err := f(c.Log); err != nil {
 				t.Error(err)
 			} else if string(out) != c.Output {
 				//TODO, as the result is a map, it is not ordered and anything can happen :(
@@ -52,7 +52,7 @@ func TestLegacyFormatter(t *testing.T) {
 	if err != nil {
 		t.Error(err)
 	}
-	var legacyAl auditLogLegacy
+	var legacyAl logLegacy
 	if err := json.Unmarshal(data, &legacyAl); err != nil {
 		t.Error(err)
 	}
diff --git a/loggers/formats_test.go b/auditlog/formats_test.go
similarity index 79%
rename from loggers/formats_test.go
rename to auditlog/formats_test.go
index 04cab12..8cebee3 100644
--- a/loggers/formats_test.go
+++ b/auditlog/formats_test.go
@@ -1,7 +1,7 @@
 // Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
 // SPDX-License-Identifier: Apache-2.0
 
-package loggers
+package auditlog
 
 import (
 	"bytes"
@@ -20,13 +20,13 @@ func TestNativeFormatter(t *testing.T) {
 	}
 }
 
-func createAuditLog() *AuditLog {
-	return &AuditLog{
-		Transaction: AuditTransaction{
+func createAuditLog() *Log {
+	return &Log{
+		Transaction: Transaction{
 			Timestamp:     "02/Jan/2006:15:04:20 -0700",
 			UnixTimestamp: 0,
 			ID:            "123",
-			Request: AuditTransactionRequest{
+			Request: TransactionRequest{
 				URI:    "/test.php",
 				Method: "GET",
 				Headers: map[string][]string{
@@ -35,7 +35,7 @@ func createAuditLog() *AuditLog {
 					},
 				},
 			},
-			Response: AuditTransactionResponse{
+			Response: TransactionResponse{
 				Status: 200,
 				Headers: map[string][]string{
 					"some": {
@@ -44,10 +44,10 @@ func createAuditLog() *AuditLog {
 				},
 			},
 		},
-		Messages: []AuditMessage{
+		Messages: []Message{
 			{
 				Message: "some message",
-				Data: AuditMessageData{
+				Data: MessageData{
 					Msg: "some message",
 					Raw: "SecAction \"id:100\"",
 				},
diff --git a/loggers/logger_test.go b/auditlog/logger_test.go
similarity index 95%
rename from loggers/logger_test.go
rename to auditlog/logger_test.go
index ddcac9f..445b771 100644
--- a/loggers/logger_test.go
+++ b/auditlog/logger_test.go
@@ -1,7 +1,7 @@
 // Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
 // SPDX-License-Identifier: Apache-2.0
 
-package loggers
+package auditlog
 
 import "testing"
 
diff --git a/loggers/serial_writer_test.go b/auditlog/serial_writer_test.go
similarity index 93%
rename from loggers/serial_writer_test.go
rename to auditlog/serial_writer_test.go
index eaf1416..1f0ac69 100644
--- a/loggers/serial_writer_test.go
+++ b/auditlog/serial_writer_test.go
@@ -4,7 +4,7 @@
 //go:build !tinygo
 // +build !tinygo
 
-package loggers
+package auditlog
 
 import (
 	"io/fs"
@@ -52,13 +52,13 @@ func TestSerialWriterWrites(t *testing.T) {
 	if err := writer.Init(config); err != nil {
 		t.Error(err)
 	}
-	al := &AuditLog{
-		Transaction: AuditTransaction{
+	al := &Log{
+		Transaction: Transaction{
 			ID: "test123",
 		},
-		Messages: []AuditMessage{
+		Messages: []Message{
 			{
-				Data: AuditMessageData{
+				Data: MessageData{
 					ID:  100,
 					Raw: "SecAction \"id:100\"",
 				},
diff --git a/config_test.go b/config_test.go
index 9f6a535..6afe4a6 100644
--- a/config_test.go
+++ b/config_test.go
@@ -6,7 +6,7 @@ package coraza
 import (
 	"testing"
 
-	"github.com/corazawaf/coraza/v3/loggers"
+	"github.com/corazawaf/coraza/v3/auditlog"
 	"github.com/corazawaf/coraza/v3/types"
 )
 
@@ -114,7 +114,7 @@ func TestConfigSetters(t *testing.T) {
 }
 
 func TestConfigLogger(t *testing.T) {
-	logger, err := loggers.GetLogWriter("concurrent")
+	logger, err := auditlog.GetLogWriter("concurrent")
 	if err != nil {
 		t.Fatal(err)
 	}
diff --git a/debuglogger/default_test.go b/debuglog/default_test.go
similarity index 99%
rename from debuglogger/default_test.go
rename to debuglog/default_test.go
index acc259f..15e7e63 100644
--- a/debuglogger/default_test.go
+++ b/debuglog/default_test.go
@@ -1,7 +1,7 @@
 // Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
 // SPDX-License-Identifier: Apache-2.0
 
-package debuglogger
+package debuglog
 
 import (
 	"bytes"
diff --git a/debuglogger/level_test.go b/debuglog/level_test.go
similarity index 98%
rename from debuglogger/level_test.go
rename to debuglog/level_test.go
index 2b259ad..e651021 100644
--- a/debuglogger/level_test.go
+++ b/debuglog/level_test.go
@@ -1,7 +1,7 @@
 // Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
 // SPDX-License-Identifier: Apache-2.0
 
-package debuglogger
+package debuglog
 
 import (
 	"fmt"
diff --git a/debuglogger/nop_test.go b/debuglog/nop_test.go
similarity index 95%
rename from debuglogger/nop_test.go
rename to debuglog/nop_test.go
index 0a32770..1394592 100644
--- a/debuglogger/nop_test.go
+++ b/debuglog/nop_test.go
@@ -1,7 +1,7 @@
 // Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
 // SPDX-License-Identifier: Apache-2.0
 
-package debuglogger
+package debuglog
 
 import (
 	"io"
diff --git a/http/middleware_test.go b/http/middleware_test.go
index ed1bb8a..455ac58 100644
--- a/http/middleware_test.go
+++ b/http/middleware_test.go
@@ -21,7 +21,7 @@ import (
 	"testing"
 
 	"github.com/corazawaf/coraza/v3"
-	"github.com/corazawaf/coraza/v3/debuglogger"
+	"github.com/corazawaf/coraza/v3/debuglog"
 	"github.com/corazawaf/coraza/v3/internal/corazawaf"
 	"github.com/corazawaf/coraza/v3/internal/seclang"
 	"github.com/corazawaf/coraza/v3/macro"
@@ -293,9 +293,9 @@ func TestHttpServer(t *testing.T) {
 		},
 	}
 
-	logger := debuglogger.Default().
+	logger := debuglog.Default().
 		WithOutput(testLogOutput{t}).
-		WithLevel(debuglogger.LogLevelInfo)
+		WithLevel(debuglog.LogLevelInfo)
 
 	// Perform tests
 	for name, tCase := range tests {
@@ -355,9 +355,9 @@ func TestHttpServerWithRuleEngineOff(t *testing.T) {
 			expectedRespBody: "Waf is Off!",
 		},
 	}
-	logger := debuglogger.Default().
+	logger := debuglog.Default().
 		WithOutput(testLogOutput{t}).
-		WithLevel(debuglogger.LogLevelInfo)
+		WithLevel(debuglog.LogLevelInfo)
 
 	// Perform tests
 	for name, tCase := range tests {
diff --git a/internal/corazawaf/transaction_test.go b/internal/corazawaf/transaction_test.go
index 53c9a89..bc58f0f 100644
--- a/internal/corazawaf/transaction_test.go
+++ b/internal/corazawaf/transaction_test.go
@@ -13,7 +13,7 @@ import (
 	"testing"
 
 	"github.com/corazawaf/coraza/v3/collection"
-	"github.com/corazawaf/coraza/v3/debuglogger"
+	"github.com/corazawaf/coraza/v3/debuglog"
 	"github.com/corazawaf/coraza/v3/internal/collections"
 	"github.com/corazawaf/coraza/v3/internal/corazarules"
 	utils "github.com/corazawaf/coraza/v3/internal/strings"
@@ -693,7 +693,7 @@ func TestRelevantAuditLogging(t *testing.T) {
 	tx.WAF.AuditLogRelevantStatus = regexp.MustCompile(`(403)`)
 	tx.variables.responseStatus.Set("403")
 	tx.AuditEngine = types.AuditEngineRelevantOnly
-	// tx.WAF.auditLogger = loggers.NewAuditLogger()
+	// tx.WAF.auditLogger = auditlog.NewAuditLogger()
 	tx.ProcessLogging()
 	// TODO how do we check if the log was writen?
 	if err := tx.Close(); err != nil {
@@ -962,7 +962,7 @@ func TestTxSetServerName(t *testing.T) {
 
 	waf := NewWAF()
 	waf.SetDebugLogOutput(l)
-	_ = waf.SetDebugLogLevel(debuglogger.LogLevelWarn)
+	_ = waf.SetDebugLogLevel(debuglog.LogLevelWarn)
 
 	tx := waf.NewTransaction()
 	tx.LastPhase = types.PhaseRequestHeaders
@@ -1188,7 +1188,7 @@ func TestProcessorsIdempotency(t *testing.T) {
 
 	waf := NewWAF()
 	waf.SetDebugLogOutput(l)
-	_ = waf.SetDebugLogLevel(debuglogger.LogLevelError)
+	_ = waf.SetDebugLogLevel(debuglog.LogLevelError)
 
 	expectedInterruption := &types.Interruption{
 		RuleID: 123,
diff --git a/internal/seclang/directives_log_test.go b/internal/seclang/directives_log_test.go
index 437f162..ef688a5 100644
--- a/internal/seclang/directives_log_test.go
+++ b/internal/seclang/directives_log_test.go
@@ -15,9 +15,9 @@ import (
 	"strings"
 	"testing"
 
+	"github.com/corazawaf/coraza/v3/auditlog"
 	"github.com/corazawaf/coraza/v3/internal/corazawaf"
 	utils "github.com/corazawaf/coraza/v3/internal/strings"
-	"github.com/corazawaf/coraza/v3/loggers"
 	"github.com/corazawaf/coraza/v3/types"
 )
 
@@ -40,9 +40,9 @@ func TestSecAuditLogDirectivesConcurrent(t *testing.T) {
 		t.Error("Invalid audit logger (nil)")
 		return
 	}
-	if err := waf.AuditLogWriter.Write(&loggers.AuditLog{
+	if err := waf.AuditLogWriter.Write(&auditlog.Log{
 		Parts: types.AuditLogParts("ABCDEFGHIJKZ"),
-		Transaction: loggers.AuditTransaction{
+		Transaction: auditlog.Transaction{
 			ID: id,
 		},
 	}); err != nil {
diff --git a/testing/auditlog_test.go b/testing/auditlog_test.go
index 2090493..3610865 100644
--- a/testing/auditlog_test.go
+++ b/testing/auditlog_test.go
@@ -15,9 +15,9 @@ import (
 	"path/filepath"
 	"testing"
 
+	"github.com/corazawaf/coraza/v3/auditlog"
 	"github.com/corazawaf/coraza/v3/internal/corazawaf"
 	"github.com/corazawaf/coraza/v3/internal/seclang"
-	"github.com/corazawaf/coraza/v3/loggers"
 )
 
 func TestAuditLogMessages(t *testing.T) {
@@ -56,7 +56,7 @@ func TestAuditLogMessages(t *testing.T) {
 	if _, err := file.Seek(0, 0); err != nil {
 		t.Error(err)
 	}
-	var al2 loggers.AuditLog
+	var al2 auditlog.Log
 	if err := json.NewDecoder(file).Decode(&al2); err != nil {
 		t.Error(err)
 	}
@@ -98,7 +98,7 @@ func TestAuditLogRelevantOnly(t *testing.T) {
 		t.Error(err)
 	}
 	tx.ProcessLogging()
-	var al2 loggers.AuditLog
+	var al2 auditlog.Log
 	// this should fail, there should be no log
 	if err := json.NewDecoder(file).Decode(&al2); err == nil {
 		t.Error(err)
@@ -135,7 +135,7 @@ func TestAuditLogRelevantOnlyOk(t *testing.T) {
 		t.Error(err)
 	}
 	tx.ProcessLogging()
-	var al2 loggers.AuditLog
+	var al2 auditlog.Log
 	// this should pass as it matches any status
 	if err := json.NewDecoder(file).Decode(&al2); err != nil {
 		t.Error(err)
@@ -172,7 +172,7 @@ func TestAuditLogRelevantOnlyNoAuditlog(t *testing.T) {
 		t.Error(err)
 	}
 	tx.ProcessLogging()
-	var al2 loggers.AuditLog
+	var al2 auditlog.Log
 	// there should be no audit log because of noauditlog
 	if err := json.NewDecoder(file).Decode(&al2); err == nil {
 		t.Errorf("there should be no audit log, got %v", al2)