Has anybody got this working yet? I was trying to put a logger in a function, but using their sample code gives me an error. Cannot find anything like Ice.Logging or Ice.ApplicationLogging to add in the references or services list. What am I missing?
2 Likes
hmwillett
(Hannah Willett)
November 27, 2024, 3:37pm
2
Seems like you have to add some stuff yourself.
5 Likes
Didn’t read far enough lol. I was looking for Ice.Logging.
1 Like
hmwillett
(Hannah Willett)
November 27, 2024, 3:45pm
4
To be fair, it should probably have that info near the top, lol.
1 Like
hmwillett
(Hannah Willett)
November 27, 2024, 3:55pm
5
This is kinda neat. Didn’t know this was a thing.
1 Like
In case anybody else is having a hard time following the instructions and needs more pictures too lol:
1 Like
I guess I am still doing it wrong.
[CDATA[System.ObjectDisposedException: Cannot access a disposed object.
Object name: ‘DisposableLogger’.
at Epicor.Hosting.Trace.DisposableLogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter) in C:_releases\ICE\ICE4.3.200.0\Source\Server\Framework\Epicor.System\Hosting\Trace\DisposableLogger.cs:line 52
at Microsoft.Extensions.Logging.LoggerExtensions.Log(ILogger logger, LogLevel logLevel, EventId eventId, Exception exception, String message, Object args)
at Microsoft.Extensions.Logging.LoggerExtensions.LogInformation(ILogger logger, String message, Object args)
I was trying to put it in the catch
1 Like
hmwillett
(Hannah Willett)
November 27, 2024, 4:27pm
9
I just made it its own function.
That way you can call it from everywhere else.
4 Likes
aosemwengie1
(Alisa Osemwengie)
November 27, 2024, 4:28pm
10
I will have to try it that way instead
Olga
(Olga Klimova)
November 27, 2024, 4:30pm
11
After your code goes out of using(logger){} the logger is disposed.
2 Likes
aosemwengie1
(Alisa Osemwengie)
November 27, 2024, 4:33pm
12
Yay it worked, had a stray bracket
2 Likes
dcamlin
(David Camlin)
November 27, 2024, 4:46pm
13
First of all, I always enjoy looking at your work… the way your mind works is pretty entertaining.
Secondly… I may have a problem because when i was reading over your code, I started getting thirsty:
My mind reading var logger =
4 Likes