Skip to content

How can I get machine name into variable ? #62

Open
@LightWeight-POS

Description

@LightWeight-POS

I don't want to use Properties column for MSSQL and want to have a single column with machine name and have it's value in the table.

I tried below to retrieve machine name and other properties:

var machineName = new LoggerConfiguration().Enrich.WithMachineName().ToString();
var environmentUserName = new LoggerConfiguration().Enrich.WithEnvironmentUserName().ToString();
var environmentName = new LoggerConfiguration().Enrich.WithEnvironmentName().ToString();
var threadID = new LoggerConfiguration().Enrich.WithThreadId().ToString();
var threadName = new LoggerConfiguration().Enrich.WithThreadName().ToString();
var processID = new LoggerConfiguration().Enrich.WithProcessId().ToString();
var processName = new LoggerConfiguration().Enrich.WithProcessName().ToString();

However, in database they are not coming right and even in variable:

image

Is there any possibility that I get them in variable and insert in to custom columns of my own ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions