6 changed files with 301 additions and 4 deletions
@ -0,0 +1,68 @@ |
|||
# LINGYUN.Abp.ExceptionHandling.Emailing |
|||
|
|||
An email notification type based on the ABP framework's **IExceptionSubscriber** interface. |
|||
|
|||
## Features |
|||
|
|||
* Supports exception email notifications |
|||
* Supports custom email templates |
|||
* Supports multilingual email content |
|||
* Supports stack trace sending |
|||
* Supports mapping between exception types and recipient mailboxes |
|||
|
|||
## Configuration and Usage |
|||
|
|||
Before use, you need to configure **AbpExceptionHandlingOptions** to define which exceptions need notifications, |
|||
then configure **AbpEmailExceptionHandlingOptions** to define specific exception type notification methods. |
|||
|
|||
```csharp |
|||
[DependsOn( |
|||
typeof(AbpEmailingExceptionHandlingModule) |
|||
)] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
// Customize exceptions to handle |
|||
Configure<AbpExceptionHandlingOptions>(options => |
|||
{ |
|||
// Add exception types that need to be handled |
|||
options.Handlers.Add<AbpException>(); |
|||
}); |
|||
// Customize exception types that need email notifications |
|||
Configure<AbpEmailExceptionHandlingOptions>(options => |
|||
{ |
|||
// Whether to send stack trace information |
|||
options.SendStackTrace = true; |
|||
// Default receiving email for unspecified exception receivers |
|||
options.DefaultReceiveEmail = "colin.in@foxmail.com"; |
|||
// Specify which email to send for a certain exception type |
|||
options.HandReceivedException<AbpException>("colin.in@foxmail.com"); |
|||
}); |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## Configuration Options |
|||
|
|||
* `SendStackTrace`: Whether to include exception stack trace in the email |
|||
* `DefaultTitle`: Default email title |
|||
* `DefaultContentHeader`: Default email content header |
|||
* `DefaultContentFooter`: Default email content footer |
|||
* `DefaultReceiveEmail`: Default exception receiving email |
|||
* `Handlers`: Dictionary mapping exception types to receiving emails |
|||
|
|||
## Localization Resources |
|||
|
|||
The module includes localization resources in the following languages: |
|||
* en |
|||
* zh-Hans |
|||
|
|||
## Related Links |
|||
|
|||
* [Base Exception Handling Module](../LINGYUN.Abp.ExceptionHandling/README.EN.md) |
|||
* [Exception Real-time Notification Module](../../../modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.EN.md) |
|||
|
|||
## More |
|||
|
|||
For more information and configuration examples, please refer to the [documentation](https://github.com/colinin/abp-next-admin). |
|||
@ -0,0 +1,46 @@ |
|||
# LINGYUN.Abp.ExceptionHandling |
|||
|
|||
A secondary extension based on the ABP framework's **IExceptionSubscriber** interface, used for customizing exception notification methods. |
|||
|
|||
## Features |
|||
|
|||
* Provides unified exception handling and notification mechanism |
|||
* Supports custom exception handlers |
|||
* Supports exception notification filtering |
|||
* Supports integration with other notification modules (such as email, real-time notifications, etc.) |
|||
|
|||
## Configuration and Usage |
|||
|
|||
Just configure **AbpExceptionHandlingOptions** to define which exceptions need to send notifications. |
|||
|
|||
```csharp |
|||
[DependsOn( |
|||
typeof(AbpExceptionHandlingModule) |
|||
)] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
// Customize exception handling |
|||
Configure<AbpExceptionHandlingOptions>(options => |
|||
{ |
|||
// Add exception types that need to be handled |
|||
options.Handlers.Add<AbpException>(); |
|||
}); |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## Configuration Options |
|||
|
|||
* `Handlers`: List of exception handlers, used to define which exception types need to be handled |
|||
* `HasNotifierError`: Check if an exception needs to send notifications |
|||
|
|||
## Extension Modules |
|||
|
|||
* [LINGYUN.Abp.ExceptionHandling.Emailing](../LINGYUN.Abp.ExceptionHandling.Emailing/README.EN.md): Exception email notification module |
|||
* [LINGYUN.Abp.ExceptionHandling.Notifications](../../../modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.EN.md): Exception real-time notification module |
|||
|
|||
## More |
|||
|
|||
For more information and configuration examples, please refer to the [documentation](https://github.com/colinin/abp-next-admin). |
|||
@ -0,0 +1,66 @@ |
|||
# LINGYUN.Abp.ExceptionHandling.Notifications |
|||
|
|||
A real-time notification type based on the ABP framework's **IExceptionSubscriber** interface, used to send exception information to users through real-time notifications. |
|||
|
|||
## Features |
|||
|
|||
* Supports real-time exception notifications |
|||
* Supports multi-tenancy |
|||
* Supports notification templates |
|||
* Supports system-level notifications |
|||
* Integrated with common notification module |
|||
|
|||
## Configuration and Usage |
|||
|
|||
Before use, you need to configure **AbpExceptionHandlingOptions** to define which exceptions need notifications. |
|||
|
|||
```csharp |
|||
[DependsOn( |
|||
typeof(AbpNotificationsExceptionHandlingModule) |
|||
)] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
// Customize exceptions to handle |
|||
Configure<AbpExceptionHandlingOptions>(options => |
|||
{ |
|||
// Add exception types that need to be handled |
|||
options.Handlers.Add<AbpException>(); |
|||
}); |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## Notification Content |
|||
|
|||
Exception notifications include the following information: |
|||
* `header`: Exception notification header information |
|||
* `footer`: Exception notification footer information |
|||
* `loglevel`: Log level |
|||
* `stackTrace`: Exception stack trace information |
|||
|
|||
## Notification Names |
|||
|
|||
The module uses the following notification names: |
|||
* `NotificationsCommonNotificationNames.ExceptionHandling`: Exception handling notification name |
|||
|
|||
## Notification Template |
|||
|
|||
* Sender: System |
|||
* Notification Level: Error |
|||
* Multi-tenant Support: Yes |
|||
|
|||
## Dependencies |
|||
|
|||
* `AbpExceptionHandlingModule`: Base exception handling module |
|||
* `AbpNotificationsCommonModule`: Common notification module |
|||
|
|||
## Related Links |
|||
|
|||
* [Base Exception Handling Module](../../../framework/common/LINGYUN.Abp.ExceptionHandling/README.EN.md) |
|||
* [Exception Email Notification Module](../../../framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.EN.md) |
|||
|
|||
## More |
|||
|
|||
For more information and configuration examples, please refer to the [documentation](https://github.com/colinin/abp-next-admin). |
|||
@ -0,0 +1,66 @@ |
|||
# LINGYUN.Abp.ExceptionHandling.Notifications |
|||
|
|||
基于abp框架底层的**IExceptionSubscriber**的实时通知类型,用于将异常信息通过实时通知方式发送给用户。 |
|||
|
|||
## 功能特性 |
|||
|
|||
* 支持异常实时通知 |
|||
* 支持多租户 |
|||
* 支持通知模板 |
|||
* 支持系统级通知 |
|||
* 集成了通用通知模块 |
|||
|
|||
## 配置使用 |
|||
|
|||
使用前需要配置**AbpExceptionHandlingOptions**定义需要发送通知的异常。 |
|||
|
|||
```csharp |
|||
[DependsOn( |
|||
typeof(AbpNotificationsExceptionHandlingModule) |
|||
)] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
// 自定义需要处理的异常 |
|||
Configure<AbpExceptionHandlingOptions>(options => |
|||
{ |
|||
// 加入需要处理的异常类型 |
|||
options.Handlers.Add<AbpException>(); |
|||
}); |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## 通知内容 |
|||
|
|||
异常通知包含以下信息: |
|||
* `header`: 异常通知头部信息 |
|||
* `footer`: 异常通知底部信息 |
|||
* `loglevel`: 日志级别 |
|||
* `stackTrace`: 异常堆栈信息 |
|||
|
|||
## 通知名称 |
|||
|
|||
模块使用以下通知名称: |
|||
* `NotificationsCommonNotificationNames.ExceptionHandling`: 异常处理通知名称 |
|||
|
|||
## 通知模板 |
|||
|
|||
* 发送者: System |
|||
* 通知级别: Error |
|||
* 支持多租户: 是 |
|||
|
|||
## 依赖模块 |
|||
|
|||
* `AbpExceptionHandlingModule`: 基础异常处理模块 |
|||
* `AbpNotificationsCommonModule`: 通用通知模块 |
|||
|
|||
## 相关链接 |
|||
|
|||
* [基础异常处理模块](../../../framework/common/LINGYUN.Abp.ExceptionHandling/README.md) |
|||
* [异常邮件通知模块](../../../framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.md) |
|||
|
|||
## 更多 |
|||
|
|||
有关更多信息和配置示例,请参阅[文档](https://github.com/colinin/abp-next-admin)。 |
|||
Loading…
Reference in new issue