title: How to use logging in pydantic/fast API
body: <p>I am using fast API for creating an API and want to use logging to create csv logs.
  The API code looks like below:</p>
  <pre><code>@app.post(&quot;/path&quot;)
  async def return_something(header: header, body: body):
      ...
      logger.info('....')
      return something
  </code></pre>
  <p>Pydantic models are defined like this:</p>
  <pre><code>class header(BaseModel):
      field1: str
      field2: list
  </code></pre>
  <p>I am using logger like this</p>
  <pre><code>from logger import ApplicationLogger
  logger = ApplicationLogger()
  </code></pre>
  <p>The question is how can I use the existing longing to log <strong>pydantic</strong> errors for field verification?</p>