IronPDF 故障排除 AWS 日志文件 在 IronPDF 中排查 AWS 日誌檔案故障 Curtis Chau 更新:2025年6月11日 下載 IronPDF NuGet 下載 DLL 下載 Windows 安裝程式 開始免費試用 法學碩士副本 法學碩士副本 將頁面複製為 Markdown 格式,用於 LLMs 在 ChatGPT 中打開 請向 ChatGPT 諮詢此頁面 在雙子座打開 請向 Gemini 詢問此頁面 在 Grok 中打開 向 Grok 詢問此頁面 打開困惑 向 Perplexity 詢問有關此頁面的信息 分享 在 Facebook 上分享 分享到 X(Twitter) 在 LinkedIn 上分享 複製連結 電子郵件文章 This article was translated from English: Does it need improvement? Translated View the article in English 使用 S3 儲存桶隔離 IronPDF 日誌 在 AWS 環境中排查 IronPDF 問題時,從 IronPDF 庫本身取得乾淨、專用的日誌非常有幫助。 這種方法有助於避免從 Amazon CloudWatch Logs 或 AWS Application Insights 等服務中篩選合併日誌流的複雜性。 CloudWatch Logs 和 Application Insights 等服務通常會聚合來自各種來源的日誌,包括您的應用程式程式碼、其他程式庫和 AWS 服務。 這種交錯方式可能會使難以精確定位 IronPDF 特有的訊息,並直接診斷與 PDF 產生或操作相關的問題。 為了克服這些挑戰,我們建議將 IronPDF 配置為將其日誌寫入 AWS 運算環境暫存中的專用檔案。 然後,可以輕鬆將此隔離的日誌檔案上傳到 Amazon S3 儲存桶,以便於下載、查看,並在需要時與支援人員共用。 啟用並配置 IronPDF 日誌記錄 var awsTmpPath = @"/tmp/"; IronSoftware.Logger.LoggingMode = IronSoftware.Logger.LoggingModes.All; IronSoftware.Logger.LogFilePath = awsTmpPath + "default.txt"; var awsTmpPath = @"/tmp/"; IronSoftware.Logger.LoggingMode = IronSoftware.Logger.LoggingModes.All; IronSoftware.Logger.LogFilePath = awsTmpPath + "default.txt"; $vbLabelText $csharpLabel 將日誌檔案上傳到 Amazon S3 儲存桶 // File path in the Lambda /tmp directory var filePath = $"/tmp/default.txt"; // Read the file as byte array var fileBytes = await File.ReadAllBytesAsync(filePath); // Upload the text file to S3 using (var memoryStream = new MemoryStream(fileBytes)) { var request = new PutObjectRequest { BucketName = bucketName, Key = "default.txt", InputStream = memoryStream, ContentType = "text/plain", }; await _s3Client.PutObjectAsync(request); } // File path in the Lambda /tmp directory var filePath = $"/tmp/default.txt"; // Read the file as byte array var fileBytes = await File.ReadAllBytesAsync(filePath); // Upload the text file to S3 using (var memoryStream = new MemoryStream(fileBytes)) { var request = new PutObjectRequest { BucketName = bucketName, Key = "default.txt", InputStream = memoryStream, ContentType = "text/plain", }; await _s3Client.PutObjectAsync(request); } $vbLabelText $csharpLabel 有關 AWS 特定日誌記錄服務,請參閱以下文件: Amazon CloudWatch Amazon CloudWatch Logs 服務可讓您近乎即時地收集和儲存來自您的資源、應用程式和服務的日誌。 -https://aws.amazon.com/cloudwatch/ https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/aws-services-sending-logs.html 附加日誌記錄 有關 Amazon CloudWatch Logs、Amazon S3 Logs 和發送到 Kinesis Data Firehose 的日誌的更多信息,請參閱: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html 公共服務 AWS Lambda https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs.html Amazon EC2 https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html Curtis Chau 立即與工程團隊聊天 技術撰稿人 Curtis Chau 擁有電腦科學學士學位(卡爾頓大學),專長於前端開發,精通 Node.js、TypeScript、JavaScript 和 React。Curtis 對製作直覺且美觀的使用者介面充滿熱情,他喜歡使用現代化的架構,並製作結構良好且視覺上吸引人的手冊。除了開發之外,Curtis 對物聯網 (IoT) 也有濃厚的興趣,他喜歡探索整合硬體與軟體的創新方式。在空閒時間,他喜歡玩遊戲和建立 Discord bots,將他對技術的熱愛與創意結合。 準備好開始了嗎? Nuget 下載 17,570,948 | 版本: 2026.2 剛剛發布 免費 NuGet 下載 總下載量:17,570,948 查看許可證