Base solution for your next web application

Activities of "uabel"

Hello, I tried it now with ABP 3.8.3 and Log4Net 2.0.8 in another project. There it goes without problems. So it could be because of the log4net version.

We are now considering whether we can initialize a different logging framework in Global.aspx.

AbpBootstrapper.IocManager.IocContainer .AddFacility<LoggingFacility>(f => f.UseAbpLog4Net() .WithConfig(Server.MapPath("log4net.config"))

https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-trace-logs

Hello, yes the path is ok, and the log is also created.

I am now testing another solution with a newer Log4Net version.

Hello, this is running on Azure App Services. We write the log to the file system.

<?xml version="1.0" encoding="utf-8" ?> <log4net> <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender" > <file value="D:/Home/LogFiles/Log4Net/QMPilot.log" /> <appendToFile value="true" /> <rollingStyle value="Size" /> <maxSizeRollBackups value="10" /> <maximumFileSize value="10000KB" /> <staticLogFileName value="true" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%-5level %date [%-5.5thread] %-40.40logger - %message%newline" /> </layout> </appender> <root> <appender-ref ref="RollingFileAppender" /> <level value="DEBUG" /> </root> <logger name="NHibernate"> <level value="WARN" /> </logger> </log4net>

Hello, we have the problem only on Azure. We use ABP 0.7.5 and log4net 1.2.10. An update of ABP would unfortunately be relatively costly because we would have to adapt a lot.

Hello, yes that is correct and the log is also written. It just always stops after the following line: DEBUG 2022-02-17 14:35:43,675 [1 ] Abp.Modules.AbpModuleManager - 13 modules loaded.

Could it have something to do with this: https://issues.apache.org/jira/browse/LOG4NET-178

We tried to update log4net and the Caste, but apparently there is still a dependency in ABP on the old version.

Hello. We are running our application on Azure. Unfortunately the logging doesn't work there anymore. We are using e.g. public ILogger Logger { get; set; } Logger.Debug("test") These values are still written to the log: DEBUG 2022-02-15 12:55:27,651 [1 ] Abp.Modules.AbpModuleManager - 13 modules loaded. DEBUG 2022-02-15 12:56:20,096 [1 ] Abp.Localization.LocalizationManager - Initializing 4 localization sources. DEBUG 2022-02-15 12:56:20,127 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: Abp DEBUG 2022-02-15 12:56:20,127 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: AbpWeb DEBUG 2022-02-15 12:56:20,127 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: AbpZero DEBUG 2022-02-15 12:56:20,330 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: QMP3

Hello, I have the problem that I get a DynamicProxy instead of my object from the Repository. What can be the problem here? I'll get it later problems with mapping because of the _entityWrapper.

The object and the repo looks exactly like all entities. I can not find a mistake here.

Return of workflowRepository.Get(input.Workflow.Id); looks like this:

Object looks like this: `public class Workflow : Entity, IHasCreationTime, IHasModificationTime { [ForeignKey("StateId")] public virtual State State { get; set; } public int StateId { get; set; }

    [ForeignKey("ProductId")]
    public virtual Product Product { get; set; }
    public int ProductId { get; set; }

    public bool Default { get; set; }
    public bool Active { get; set; } // Aktiv ja, nein, wenn Active aber nicht SendMail müssen die Anhänge trotzdem erstellt werden
    public bool SendMail { get; set; }
    public bool AutoSend { get; set; }

    public bool SendMailToCustomer { get; set; }
    public string SendMailToBcc { get; set; }

    [JsonIgnore]
    public List<WorkflowI18N> WorkflowI18Ns { get; set; }

    [IgnoreDataMember]
    [JsonIgnore]
    public List<Template> Attachments { get; set; }

 

    public DateTime CreationTime { get; set; }
    public DateTime? LastModificationTime { get; set; }

}`


Gruss
Uwe

Sorry Unfortunately I get a 404 at the address https://github.com/aspnetzero/aspnet-zero-core/blob/48616521f7cfb2c5ca08490c3ed41f23a34d32ac/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Application/Authorization/Users/UserAppService.cs#L249

maybe you can copy the code block in here

Hello, as in the following code it works. Is there an easier way?

 protected virtual async Task UpdateTemplateAsync(CreateOrUpdateDto input)
        {
            foreach (var id18n in input.Template.TemplateI18Ns)
            {
                var thisI18N = _templateI18NRepository.Get(id18n.Id);
                id18n.MapTo(thisI18N);
                _templateI18NRepository.Update(thisI18N);
                await CurrentUnitOfWork.SaveChangesAsync();
            }
            input.Template.TemplateI18Ns = null;
            var template = _templateRepository.Get(input.Template.Id);
            input.Template.MapTo(template);
            template.TemplateI18Ns = _templateI18NRepository.GetAll().Where(r => r.TemplateId == input.Template.Id).ToList();
            template.LastModificationTime = DateTime.Now;
            _templateRepository.Update(template);
            await CurrentUnitOfWork.SaveChangesAsync();
        }

Uwe

Hello, I have the following problem. I would like to update an entity incl. the attached list of objects. Unfortunately, the attached objects are always reinserted instead of being updated.

This is what my object looks like:

public class Template : Entity, IHasCreationTime, IHasModificationTime
    {
        public string Label { get; set; }
        public virtual TemplateType Type { get; set; }
        
        [JsonIgnore]
        public List<TemplateI18N> TemplateI18Ns { get; set; }
        public DateTime CreationTime { get; set; }
        public DateTime? LastModificationTime { get; set; }
    }

For the template i18n's an insert is made instead of an update.

This is my update function in the APP service:

protected virtual async Task UpdateTemplateAsync(CreateOrUpdateDto input)
        {
            var template = await templateRepository.GetAsync(input.Template.Id);
            input.Template.MapTo(template);
            template.LastModificationTime = DateTime.Now;
            await templateRepository.UpdateAsync(template);
        }_

The template object looks like this before the update:

DB looks like this befor update:

And after Update:

What am I doing wrong?`

Thanks for your help. Uwea

Showing 11 to 20 of 31 entries