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

Logs are not created if the log folder does not exist #30

Closed
Tratcher opened this Issue Oct 27, 2016 · 10 comments

Comments

Projects
None yet
7 participants
@Tratcher
Member

Tratcher commented Oct 27, 2016

From @Tratcher on May 27, 2016 21:48

The templates set stdoutLogFile=".\logs\stdout" by default, but do not include a logs directory in the project. ANCM will not create log files unless the logs directory already exists. ANCM should create the directory.

Copied from original issue: aspnet/IISIntegration#196

@Tratcher

This comment has been minimized.

Show comment
Hide comment
@Tratcher

Tratcher Oct 27, 2016

Member

From @guardrex on May 29, 2016 18:3

Great idea in the specified case, but it's also related to a side-issue with dotnet cli in that if we create a Logs folder in the app and include it for publishing in publishOptions > include, it will not appear in published output without a dummy file in it. dotnet/cli#1396 cc/ @piotrpMSFT @blackdwarf

The possible problem here is that devs may want to put the logs anywhere [possibly putting logs from all apps in one folder and naming the log files to match their app (e.g., stdoutLogFile="c:\logs\this_app_name")]; so, are you saying that ANCM could create the path anywhere? ... not just to .\logs ... but the full path of .\funky_folder\nutty_folder\goofy_folder or f:\put_the_log_here or \\server\share\path or whatever path the dev sticks in there?

Notwithstanding dotnet/cli#1396, this doesn't feel like a "bug" as much as it is an "ID-10T Error." 😄

Member

Tratcher commented Oct 27, 2016

From @guardrex on May 29, 2016 18:3

Great idea in the specified case, but it's also related to a side-issue with dotnet cli in that if we create a Logs folder in the app and include it for publishing in publishOptions > include, it will not appear in published output without a dummy file in it. dotnet/cli#1396 cc/ @piotrpMSFT @blackdwarf

The possible problem here is that devs may want to put the logs anywhere [possibly putting logs from all apps in one folder and naming the log files to match their app (e.g., stdoutLogFile="c:\logs\this_app_name")]; so, are you saying that ANCM could create the path anywhere? ... not just to .\logs ... but the full path of .\funky_folder\nutty_folder\goofy_folder or f:\put_the_log_here or \\server\share\path or whatever path the dev sticks in there?

Notwithstanding dotnet/cli#1396, this doesn't feel like a "bug" as much as it is an "ID-10T Error." 😄

@Tratcher

This comment has been minimized.

Show comment
Hide comment
@Tratcher

Tratcher Oct 27, 2016

Member

Also fix the path logic so the .\ isn't required, and so that even any empty path works.
aspnet/IISIntegration#119 (comment)

Moved this suggestion to #43

Member

Tratcher commented Oct 27, 2016

Also fix the path logic so the .\ isn't required, and so that even any empty path works.
aspnet/IISIntegration#119 (comment)

Moved this suggestion to #43

@Tratcher

This comment has been minimized.

Show comment
Hide comment
@Tratcher

Tratcher Aug 25, 2017

Member

@shirhatti ping This is my biggest pet peve with ANCM. I turned logging on, specified where to put them, but nothing happens.
aspnet/IISIntegration#406 (comment)

Member

Tratcher commented Aug 25, 2017

@shirhatti ping This is my biggest pet peve with ANCM. I turned logging on, specified where to put them, but nothing happens.
aspnet/IISIntegration#406 (comment)

@Tratcher

This comment has been minimized.

Show comment
Hide comment
@Tratcher
Member

Tratcher commented Aug 31, 2017

@jkotalik

This comment has been minimized.

Show comment
Hide comment
@jkotalik
Contributor

jkotalik commented Aug 31, 2017

@dasMulli

This comment has been minimized.

Show comment
Hide comment
@dasMulli

dasMulli Dec 1, 2017

This issue is requiring more and more complex workarounds for users in different deployment scenarios and the needed documentation seems overly complex for a simple deployment (@guardrex ?).

Right now, aspnet/websdk#152 (comment) suggests the following target to be created in order to work for all publishing methods:

<Target Name="CreateLogsFolder" AfterTargets="Publish">
  <MakeDir Directories="$(PublishDir)Logs" Condition="!Exists('$(PublishDir)Logs')" />
  <WriteLinesToFile File="$(PublishDir)Logs\.log" Lines="Generated file" Overwrite="True" Condition="!Exists('$(PublishDir)Logs\.log')" />
</Target>

dasMulli commented Dec 1, 2017

This issue is requiring more and more complex workarounds for users in different deployment scenarios and the needed documentation seems overly complex for a simple deployment (@guardrex ?).

Right now, aspnet/websdk#152 (comment) suggests the following target to be created in order to work for all publishing methods:

<Target Name="CreateLogsFolder" AfterTargets="Publish">
  <MakeDir Directories="$(PublishDir)Logs" Condition="!Exists('$(PublishDir)Logs')" />
  <WriteLinesToFile File="$(PublishDir)Logs\.log" Lines="Generated file" Overwrite="True" Condition="!Exists('$(PublishDir)Logs\.log')" />
</Target>
@guardrex

This comment has been minimized.

Show comment
Hide comment
@guardrex

guardrex Dec 1, 2017

Contributor

My intention is to update the workaround in the Directory Structure topic. Otherwise, our advice would be 'you just need to create the folder' and leave the reader hanging on how to automate it. But yeah ... I've been very interested in this one for a long time (see: dotnet/cli#1396 ... February of 2016).

Contributor

guardrex commented Dec 1, 2017

My intention is to update the workaround in the Directory Structure topic. Otherwise, our advice would be 'you just need to create the folder' and leave the reader hanging on how to automate it. But yeah ... I've been very interested in this one for a long time (see: dotnet/cli#1396 ... February of 2016).

@pan-wang

This comment has been minimized.

Show comment
Hide comment
@pan-wang

pan-wang Dec 1, 2017

Contributor

Ack. It's in the list of improvements and will be ready soon. Note that the folder creation may still fail if worker process does not have the write permission to the target folder.

Contributor

pan-wang commented Dec 1, 2017

Ack. It's in the list of improvements and will be ready soon. Note that the folder creation may still fail if worker process does not have the write permission to the target folder.

@guardrex

This comment has been minimized.

Show comment
Hide comment
@guardrex

guardrex Dec 1, 2017

Contributor

Note that the folder creation may still fail if worker process does not have the write permission to the target folder.

@pan-wang Seems like that's worth mentioning in the doc update, correct? I added it.

Contributor

guardrex commented Dec 1, 2017

Note that the folder creation may still fail if worker process does not have the write permission to the target folder.

@pan-wang Seems like that's worth mentioning in the doc update, correct? I added it.

@muratg

This comment has been minimized.

Show comment
Hide comment
@muratg

muratg Dec 20, 2017

Member

Thanks @guardrex for the doc update! aspnet/websdk#273 would also mitigate this in the publish case (causing the folder to be created at the time of publish.)

Closing this. @shirhatti reminder: please follow up with @vijayrkn on the status of the websdk bug.

Member

muratg commented Dec 20, 2017

Thanks @guardrex for the doc update! aspnet/websdk#273 would also mitigate this in the publish case (causing the folder to be created at the time of publish.)

Closing this. @shirhatti reminder: please follow up with @vijayrkn on the status of the websdk bug.

@muratg muratg closed this Dec 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment