How can I specify a specific log file to write to from a Sitecore Powershell script?
I have some scripts where I'd like to separate their log output from the standard Sitecore Powershell log (SPE.log).
Is there a parameter which I can use on Write-Log
to output to a named log file?
powershell-extensions
add a comment |
I have some scripts where I'd like to separate their log output from the standard Sitecore Powershell log (SPE.log).
Is there a parameter which I can use on Write-Log
to output to a named log file?
powershell-extensions
add a comment |
I have some scripts where I'd like to separate their log output from the standard Sitecore Powershell log (SPE.log).
Is there a parameter which I can use on Write-Log
to output to a named log file?
powershell-extensions
I have some scripts where I'd like to separate their log output from the standard Sitecore Powershell log (SPE.log).
Is there a parameter which I can use on Write-Log
to output to a named log file?
powershell-extensions
powershell-extensions
edited Dec 5 at 14:04
Pratik Wasnik
329114
329114
asked Dec 5 at 10:11
James Walford
500312
500312
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You cannot. It doesn't support anything like that.
Here is a documentation of Write-Log cmldet.
If you are interested you can see how it is implemented:
- WriteLogCommand.cs
- PowerShellLog.cs
SPE jsut defines it own log4net appender, see configuration here Cognifide.PowerShell.config (serach for PowerShellExtensionsFileAppender
)
You would have to implement your own solution with dynamic appenders.
This might give you an idea of where to start: How to add log4net appender in runtime?
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "664"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsitecore.stackexchange.com%2fquestions%2f15380%2fhow-can-i-specify-a-specific-log-file-to-write-to-from-a-sitecore-powershell-scr%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You cannot. It doesn't support anything like that.
Here is a documentation of Write-Log cmldet.
If you are interested you can see how it is implemented:
- WriteLogCommand.cs
- PowerShellLog.cs
SPE jsut defines it own log4net appender, see configuration here Cognifide.PowerShell.config (serach for PowerShellExtensionsFileAppender
)
You would have to implement your own solution with dynamic appenders.
This might give you an idea of where to start: How to add log4net appender in runtime?
add a comment |
You cannot. It doesn't support anything like that.
Here is a documentation of Write-Log cmldet.
If you are interested you can see how it is implemented:
- WriteLogCommand.cs
- PowerShellLog.cs
SPE jsut defines it own log4net appender, see configuration here Cognifide.PowerShell.config (serach for PowerShellExtensionsFileAppender
)
You would have to implement your own solution with dynamic appenders.
This might give you an idea of where to start: How to add log4net appender in runtime?
add a comment |
You cannot. It doesn't support anything like that.
Here is a documentation of Write-Log cmldet.
If you are interested you can see how it is implemented:
- WriteLogCommand.cs
- PowerShellLog.cs
SPE jsut defines it own log4net appender, see configuration here Cognifide.PowerShell.config (serach for PowerShellExtensionsFileAppender
)
You would have to implement your own solution with dynamic appenders.
This might give you an idea of where to start: How to add log4net appender in runtime?
You cannot. It doesn't support anything like that.
Here is a documentation of Write-Log cmldet.
If you are interested you can see how it is implemented:
- WriteLogCommand.cs
- PowerShellLog.cs
SPE jsut defines it own log4net appender, see configuration here Cognifide.PowerShell.config (serach for PowerShellExtensionsFileAppender
)
You would have to implement your own solution with dynamic appenders.
This might give you an idea of where to start: How to add log4net appender in runtime?
answered Dec 5 at 10:24
Alan Płócieniak
7,4591332
7,4591332
add a comment |
add a comment |
Thanks for contributing an answer to Sitecore Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsitecore.stackexchange.com%2fquestions%2f15380%2fhow-can-i-specify-a-specific-log-file-to-write-to-from-a-sitecore-powershell-scr%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown