gaelcolas / gaelcolas/log4ps

Log File not being created

Open
#3 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
19
Forks
9
PR merge metrics
No merged PRs in 30d

Description

I'm having a similar issue as [Issue#2](https://github.com/gaelcolas/log4ps/issues/2)

I've tried this on windows 10 Version 1607 (anniversary edition) (OS build 14393.223) and Windows Server 2012 R2 Version 6.3 (Build 9600) and OS versions are unable to create the log file in `demo6.ps1`.

See below for details on the Windows 10 computer :
## **Installation and running demo6**

```
PS C:\ps> git clone --recurse-submodules git@github.com:gaelcolas/log4ps.git
Cloning into 'log4ps'...
remote: Counting objects: 2707, done.
remote: Total 2707 (delta 0), reused 0 (delta 0), pack-reused 2707
Receiving objects: 100% (2707/2707), 6.42 MiB | 3.65 MiB/s, done.
Resolving deltas: 100% (2404/2404), done.
Submodule 'lib/lib.common' (https://github.com/gaelcolas/lib.common) registered for path 'lib/lib.common'
Cloning into 'C:/ps/log4ps/lib/lib.common'...
Submodule path 'lib/lib.common': checked out '03c77de4e8a779138bd6dfbf12f4ca62693806b3'
PS C:\ps> cd .\log4ps\examples\
PS C:\ps\log4ps\examples> .\demo6.ps1
INFO - This test is killing puppies
This test is killing puppies
INFO - This is a verbose msg
DEBUG - Debug message
WARN - This is a WARN msg!
WARNING: This is a WARN msg!
ERROR - This is an error
Write-Error : This is an error
At C:\ps\log4ps\examples\demo6.ps1:9 char:1
+ Write-Error 'This is an error'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Error

Get-Content : Cannot find path 'C:\Users\KEVIN~1.CAR\AppData\Local\Temp\example.log' because it does not exist.
At C:\ps\log4ps\examples\demo6.ps1:11 char:1
+ Get-Content $env:TMP\example.log
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\KEVIN~...emp\example.log:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
```
## **Powershell Version**

PSVersion => 5.1.14393.223
PSEdition => Desktop
PSCompatibleVersions =>{1.0, 2.0, 3.0, 4.0...}
BuildVersion => 10.0.14393.223
CLRVersion => 4.0.30319.42000
WSManStackVersion =>3.0
PSRemotingProtocolVersion => 2.3
SerializationVersion => 1.1.0.1
## **.NET Framework Version**

.NET Framework 4.6.2

I've also tried to replace the xml config with the one used in the solution of Issue#2, but that did not work either.

Any suggestions to further troubleshoot this would be greatly appreciated.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with examples/demo6.ps1 and the XML configuration referenced in the issue, then compare the behavior with Issue#2. Reproduce the run on the reported Windows and PowerShell versions; done means demo6.ps1 creates example.log under the expected temporary path and Get-Content can read it.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.