IronPDF 故障排除 AWS日志文件 在 IronPDF 中排除 AWS 日志文件故障 Curtis Chau 已更新:2025年6月11日 下载 IronPDF NuGet 下载 DLL 下载 Windows 安装程序 免费试用 LLM副本 LLM副本 将页面复制为 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 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。 准备开始了吗? Nuget 下载 17,803,474 | 版本: 2026.3 刚刚发布 免费试用 免费 NuGet 下载 总下载量:17,803,474 查看许可证 还在滚动吗? 想快速获得证据? PM > Install-Package IronPdf 运行示例看着你的HTML代码变成PDF文件。 免费 NuGet 下载 总下载量:17,803,474 查看许可证