# Access logging for replacePathRegex

**URL:** <https://community.traefik.io/t/access-logging-for-replacepathregex/17498>\
**Category:** Traefik v2\
**Tags:** middleware\
**Created:** [February 10, 2023, 1:05pm UTC](https://community.traefik.io/t/access-logging-for-replacepathregex/17498 "2023-02-10T13:05:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sethlinn1](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@sethlinn1](https://community.traefik.io/u/sethlinn1)\
**Post date:** [February 10, 2023, 1:05pm UTC](https://community.traefik.io/t/access-logging-for-replacepathregex/17498/1 "2023-02-10T13:05:25Z")

</div>

Hello Team,  
First of all I would like to say thanks for the great product!  
My question is, if you have middleware like this for example:

```auto
http:
  middlewares:
    test-replacepathregex:
      replacePathRegex:
        regex: "^/foo/(.*)"
        replacement: "/bar/$1"

```

How can you see what is actually getting passed on? In other words, what does the new Path look like? This can be tricky if you have a complex regex.  
FYI, I have enabled access logging with 'format: json' but it isn't in there.  
Big thanks!

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [February 10, 2023, 1:58pm UTC](https://community.traefik.io/t/access-logging-for-replacepathregex/17498/2 "2023-02-10T13:58:24Z")

</div>

I can see before and after in [Traefik debug log](https://doc.traefik.io/traefik/observability/logs/#level):

```
X-Replaced-Path: /xmas/12345
Path: /hohoho/12345

```

when using

```
  - traefik.http.middlewares.myreplace.replacepathregex.regex=/xmas/(.*)
  - traefik.http.middlewares.myreplace.replacepathregex.replacement=/hohoho/$$1

```

---

<div class="post-metadata">

**Author:** ![sethlinn1](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@sethlinn1](https://community.traefik.io/u/sethlinn1)\
**Post date:** [June 12, 2023, 10:30am UTC](https://community.traefik.io/t/access-logging-for-replacepathregex/17498/3 "2023-06-12T10:30:06Z")

</div>

Hello,  
Sorry for the late reply. The before and after

```auto
X-Replaced-Path: /xmas/12345
Path: /hohoho/12345

```

that you mention is something that would show up in the access log not the regular log no? In my access log I can see X-Replaced-Path but not Path Is it possible that we are using different versions? I am using 2.9.x  
I have my this in my traefik.yml file

```auto
log: 
  level: DEBUG
  filePath: /logs/debug.log
  format: json

```

I assume this is correct?  
Thanks  
Seth
