Open Closed

Set name for background workers / jobs in Hangfire #10398


User avatar
0
scott7106 created

The ABP background workers and jobs have some awful names in the Hangfire dashboard. The Volo.Abp.Identity.Session.IdentitySessionCleanupBackgroundWorker is acceptable to me even if it is a bit long. However, HangfirePeriodicBackgroundWorker<BackgroundJobWork>.DoWorkAsync is simply awful for the recurringJobId. What is the cleanest way to set the name of these recurring jobs to a more user friendly name?

A secondary question would be if there is a way to remove log entries for these jobs which run every 5 minutes after a relatively short period of time? They clutter up the administration dashboard obscuring the "application" jobs statuses in the clutter.


4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can Custom Job Name by configure GetBackgroundJobName delegate of the AbpBackgroundJobOptions to change the default job name.

    Configure<AbpBackgroundJobOptions>(options =>
    {
        options.GetBackgroundJobName = (jobType) =>
        {
            if (jobTyep == typeof(EmailSendingArgs))
            {
                return "emails";
            }
    
            return BackgroundJobNameAttribute.GetName(jobType);
        };
    });
    

    Thanks.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    if there is a way to remove log entries for these jobs which run every 5 minutes after a relatively short period of time?

    It seems this is related to Hangfire Dashboard?

    Thanks.

  • User Avatar
    0
    scott7106 created

    Yes. This is related to the Hangfire Dashboard and the ID for the job shown there.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    This is related to the Hangfire Dashboard and the ID for the job shown there.

    Maybe you can customize the Hangfire Dashboard page, but the ABP framework hasn’t changed it.

    Thanks.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.2.0-preview. Updated on February 05, 2026, 13:24
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.