I was finally able to make it work. For everyone who wonders, you'll need to add the configuration in the "Shared.Hosting" project. under the class SerilogConfigurationHelper. There I used the nuget for SerilogSinksSendgrid and done
sure. no problem. : )
Hi Maliming, we got a project were we are sure the emailing is working, however I still can't make the serilog send an email with the error, is there any demo for this with ABP? I couldn't find any information about this.
Also when adding the Sink for file/console it is only logging the httpapihist errors, not the one in the other layers, how can we implement so we see the erros from all the layers ? As I am sure if I fix the email issue I will only get the errors from the httpapihost layer
hi
You need to make sure your email sender configuration is correct.
Then use
WriteTo.Email
in all projects that want to use email to output logs.https://github.com/serilog/serilog-sinks-email
Hi Maliming,
Thanks I'll review it as soon as possible and will ask if I got any other question. Thanks again!
hi
but it doesnt work, that's why I was checking if the file log worked. but it didnt...
You can test your mail sender configuration via https://github.com/abpframework/abp-samples/tree/master/EmailSendDemo https://github.com/serilog/serilog-sinks-email/blob/dev/src/Serilog.Sinks.Email/Sinks/Email/MailKitEmailTransport.cs#L24-L37
Hi Maliming thanks for the answer, I don't require to do any other configuration in the Program file?
hi
Each website has its log configuration. They are usually written to the
Logs.txt
.
If you want all website logs written to a single file. You can configure a shared log file.
Hi Maliming actually what I need is to send them via email with send grid and also record them in the application insight, however I am doing a proof of concept. And what I found in this test is that it doesn't write to the log file that I specified. However with what you mentioned could be a reason on why it is not writting to the file I mention.
How can I achieve to send the error logs to the email? I tried using
.WriteTo.Email( fromEmail: "thisisanexample@example.com", toEmail: "cijal75666@minhlun.com", mailServer: "smtp.sendgrid.net", restrictedToMinimumLevel: LogEventLevel.Error )
but it doesnt work, that's why I was checking if the file log worked. but it didnt...
Hey Guys,
We want to use the serilog sinks to log what ever issue happens inside the Application layer of the microservices. However I added the configuration for the sinks and when I throw an issue in the Application layer it is never picked up in the logs.
I have this configuration in the Program.cs file in the HttpApi.Host.
On the file it only writes what I have in the line 35, besides that It never gets an error.
This is how I am throwing an error and logging it using ILogger in the AppService under the project Application:
This is my file:
What else should I add to the configuration to make it work?
Let me know if I can provide more information
Thanks!
Hello,
I apologies for misunderstanding.
In ABP commercial when we add any module as a source code then it is given as aProjectReference
in .csproj files likeThis module is professional one so its like
Volo.Identity.Pro
and for module source code the reference is given as aPackageReference
in .csproj files like because the Professional modules are build on top of basic modules. For basic modules we need to use Nuget Package references.Thanks
I see, thanks for the explanation, however, how do I make the error go away if I want to import the source code and execute Identity?
Hello,
Try to change
PackageReference
toProjectReference
and check again.Thanks
Please let me know if I can share more info to be able to fix this one.
Thanks
Hello,
Try to change
PackageReference
toProjectReference
and check again.Thanks
Hi, thanks for the response.
I think you miss understood what I mentioned. In my project I have:
However in the source code I see the following:
I am not mentioning this is what causes the issue I reported, but it's something that I see that doesn't make much sense from what I saw in the other modules I imported the source code
ABP Framework version: v7.2.2
UI Type: Angular
Database System: EF Core (SQL Server)
Auth Server Separated (for Angular): yes
Exception message and full stack trace:
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder
1 derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.Attribute.GetCustomAttributes(MemberInfo element, Boolean inherit)
at Volo.Abp.Modularity.AbpModuleHelper.FindDependedModuleTypes(Type moduleType)
at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List1 moduleTypes, Type moduleType, ILogger logger, Int32 depth) at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List
1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List1 moduleTypes, Type moduleType, ILogger logger, Int32 depth) at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List
1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
at Volo.Abp.Modularity.AbpModuleHelper.FindAllModuleTypes(Type startupModuleType, ILogger logger)
at Volo.Abp.Modularity.ModuleLoader.FillModules(List1 modules, IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources) at Volo.Abp.Modularity.ModuleLoader.GetDescriptors(IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources) at Volo.Abp.Modularity.ModuleLoader.LoadModules(IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources) at Volo.Abp.AbpApplicationBase.LoadModules(IServiceCollection services, AbpApplicationCreationOptions options) at Volo.Abp.AbpApplicationBase..ctor(Type startupModuleType, IServiceCollection services, Action
1 optionsAction)
at Volo.Abp.AbpApplicationWithExternalServiceProvider..ctor(Type startupModuleType, IServiceCollection services, Action1 optionsAction) at Volo.Abp.AbpApplicationFactory.Create(Type startupModuleType, IServiceCollection services, Action
1 optionsAction)
at Volo.Abp.AbpApplicationFactory.<CreateAsync>d__21.MoveNext() at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.<AddApplicationAsync>d__2
1.MoveNext()
at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.<AddApplicationAsync>d__0`1.MoveNext()
at NVC.Flyguys.IdentityService.Program.
Steps to reproduce the issue:
Hi team,
We are trying to to replace a few front end changes from the Identity Service (Specifically the user creator, we want to replace the username and add a few custom validations). However when I dowloaded the source code with the Abp Suite, when I execute the project to check if its working correctly after using the suite to add the source code I get this error:
Volo.Abp.Identity.Pro.Domain.Shared, Version=7.2.2.0, Culture=neutral, PublicKeyToken=null
I was checking and I see that the source code has this package reference, so I am not sure if this should be like that and not point to the local reference
Let me know if I can provide more information
Thanks!