diff --git a/src/alpine_bits_python/api.py b/src/alpine_bits_python/api.py index 92ca0bb..2e7dea7 100644 --- a/src/alpine_bits_python/api.py +++ b/src/alpine_bits_python/api.py @@ -449,6 +449,16 @@ async def alpinebits_server_handshake( try: body = gzip.decompress(body) logger.info("Successfully decompressed gzip content") + + # log request to file like in wix-form/test + logs_dir = "logs" + if not os.path.exists(logs_dir): + os.makedirs(logs_dir, mode=0o755, exist_ok=True) + log_filename = f"{logs_dir}/alpinebits_request_{datetime.now().strftime('%Y%m%d_%H%M%S')}.xml" + with open(log_filename, "wb") as f: + f.write(body) + + except Exception as e: raise HTTPException( status_code=400,