Base solution for your next web application

Activities of "uabel"

Hello, both are fulfilled in this way.

Uwe

Answer

Thank you very much for the answer. Can you then also read out here which call it is? If so, what is the definition for this?

This is the function, here I try for example to also log the userId: `abp.log.log = function (logObject, logLevel) { if (!window.console || !window.console.log) { return; }

    if (logLevel != undefined && logLevel < abp.log.level) {
        return;
    }
    if (abp.session.userId != null) {
        console.log("UserId: " + abp.session.userId + " " +logObject);
    }
    else
    {
        console.log("UserId: Empty " + logObject);
    }
    
};`

I'm using one of the oldest versions 0.7.5.0

It is a very long function with several calls.

` private void HieararchyWalk(List<QMP3.CoreData.CoreData> hierarchy, List

        if (hierarchy != null)
        {
            foreach (var item in hierarchy)
            {
                newParentId = item.ParentId;   
                Logger.Debug("Id: " + item.Id + " Nummer: " + item.Nr);
                List<CoreDataVersion> versions = new List<CoreDataVersion>();   
                if (!allLanguages)
                {
                    var element = _coreDataVersionRepository.GetAll().Where(r => r.CoreDataId == item.Id && r.GlobalLanguageId == defaultLanguage.Id)
                            .OrderByDescending(r => r.State == State.Freigegeben).ThenByDescending(s => s.Revision).FirstOrDefault();
                    if (element != null)
                    {
                        versions.Add(element);
                    }
                }
                else
                {
                    foreach (var lang in _globalLanguageRepository.GetLanguages())
                    {
                        var element = _coreDataVersionRepository.GetAll().Where(r => r.CoreDataId == item.Id && r.GlobalLanguageId == lang.Id)
                            .OrderByDescending(r => r.State == State.Freigegeben).ThenByDescending(s => s.Revision).FirstOrDefault();
                        if (element != null)
                        {
                            versions.Add(element);
                        }
                    }
                }
                
                item.CoreDataVersions = versions;
                //item.CoreDataVersions = _coreDataVersionRepository.GetAll().Where(r => r.CoreDataId == item.Id).ToList();
                //.Where(r => r.CoreDataId == item.Id)
                //.OrderBy(s => s.State == State.Freigegeben)
                //.ThenByDescending(s => s.Revision).ToList();
                bool versionsToCopy = false;
                
                foreach (var version in item.CoreDataVersions)
                {
                    var newElement = new CopiedElement();
                    counter++;
                    newParentId = CopyElement(version, item, newParentId, versionsToCopy);
                    newElement.Label = String.Concat(item.Nr, " ", version.Label);
                    newElement.Sprache = version.GlobalLanguage.Label;
                    copiedElements.Add(newElement);
                    versionsToCopy = true;
                }
                foreach (var ele in item.Children)
                {
                    ele.ParentId = newParentId;
                }
                CoreDataIds.Add(newParentId.Value);
                HieararchyWalk(item.Children, CoreDataIds, allLanguages);
            }
        }
    }
    public GetServiceOutput CopyStructure(GetServiceInput input)
    {
        List<QMP3.CoreData.CoreData> hierarchy = new List<QMP3.CoreData.CoreData>();
        var test = _coreDataRepository.GetAll().ToList();
        hierarchy = test
                        .Where(c => c.Id == input.CoreDataId)
                        .Select(c => new QMP3.CoreData.CoreData()
                        {
                            Id = c.Id,
                            Nr = c.Nr,
                            DataType = c.DataType,
                            Color = c.Color,
                            MenuId = c.MenuId,
                            Publish = c.Publish,
                            ParentId = c.ParentId,
                            CoreDataVersions = c.CoreDataVersions,
                            Children = GetChildren(test, c.Id)
                        })
                        .ToList();
        var coreDataIdsToDelete = new List<int>();
        defaultLanguage = _globalLanguageRepository.GetDefaultLanguage();
        HieararchyWalk(hierarchy, coreDataIdsToDelete, input.AllLanguages);
        return new GetServiceOutput
        {
            CopiedElements = copiedElements
        };
        //return null;
    }
    `
    
    

Hello,. we have now tried Nlog, unfortunately there is the same problem.

After that we tried to update the Castle Framework and Log4Net. Unfortunately this is not possible because there are dependencies in Abp.

We then also tried to go to Abp 3.8.1, unfortunately there are so many changes (tenant management) etc. that this is probably very expensive. Is there a good way to

Greetings Uwe Abel

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.

Showing 1 to 10 of 18 entries