Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added unit test: string with variable get expanded #670

Merged
1 commit merged into from
May 5, 2015
Merged

added unit test: string with variable get expanded #670

1 commit merged into from
May 5, 2015

Conversation

304NotModified
Copy link
Member

Skipped as it's unclear if its a bug

Skipped as it's unclear if its a bug
@304NotModified 304NotModified added the enhancement Improvement on existing feature label Apr 16, 2015
@304NotModified 304NotModified changed the title added unit test added unit test: string with variable get expanded Apr 16, 2015
@ghost
Copy link

ghost commented Apr 24, 2015

I believe this is a bug, shouldn't we try to fix in this pull request too?

@304NotModified
Copy link
Member Author

If it's a bug, yes. Although I could be handy to expand also strings? For configuring passwords globally etc.

@ghost
Copy link

ghost commented May 3, 2015

It could have use cases but I think it is a bit counter intuitive

@304NotModified
Copy link
Member Author

Agree. But I'm always reticent (not sure if this is the correct English word) with changing things non-backwards compatible.

@ghost
Copy link

ghost commented May 5, 2015

I'll merged the test for now, when we figure out what to do a new pull request can be added

ghost pushed a commit that referenced this pull request May 5, 2015
added unit test: string with variable get expanded
@ghost ghost merged commit cafb897 into NLog:master May 5, 2015
@304NotModified 304NotModified deleted the var-test branch May 5, 2015 22:29
@304NotModified
Copy link
Member Author

👍

@ArchonMegalon
Copy link

ArchonMegalon commented Jul 14, 2016

It seems to me that, there is a (new) bug originated in the change of the source Eventlog from the original Post: #669

I'm new to github, so - if this is not the place to say this please tell me so.

What I noticed: The EventLog-Target has as Source a Layout
https://github.com/nlog/nlog/wiki/EventLog-target

But: trying to set it like this failed:

logEvent.Properties["MySource"] = useSource;
logEvent.Properties["EventID"] = dicId.EventId;
   <target xsi:type="EventLog" name="ELNoFileName" machineName="."
            source="${event-properties:item=MySource}" log="Application"
            eventId="${event-properties:EventID}"
            layout="ELNoFileName (${event-properties:item=MySource}): ${message}"/>

It DOES set the EventID, it DOES set the source, but it seems to me it KEEPS the source the same for all logevents to the target after the first loggin-action.

Now - as you can see - it's pretty mystic for me. How to report such a bug or how to give you guys the possibility to re-create this problem?

Maybe it's also about the useSource?`Basically i fill it like this (before every call to NLog.Logger.Log):

 var eventLogSource = !string.IsNullOrEmpty(userMethod?.DeclaringType?.Assembly.GetName().Name)
                ? userMethod.DeclaringType.Assembly.GetName().Name
                : "Application Error";

Edit: Maybe it's important that I inherited my custom logging-Class from NLog.Logger?

@304NotModified
Copy link
Member Author

@ArchonMegalon is this the same issue as #1542?

@ArchonMegalon
Copy link

Hi! Yes! I was not able to find my own post again, so I opened a new issue. Sorry for that!

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement on existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants