What wrong is MPEG-DASH format? - live

I'll try to setting a live streaming by MPEG-DASH.
There are some files for MEPG-DASH.
elemental-3703198892.m4a elemental-3703228922.m4v elemental-3703266460.m4a
elemental-3703198892.m4v elemental-3703236430.m4a elemental-3703266460.m4v
elemental-3703206400.m4a elemental-3703236430.m4v elemental-3703273967.m4a
elemental-3703206400.m4v elemental-3703243937.m4a elemental-3703273967.m4v
elemental-3703213907.m4a elemental-3703243937.m4v elemental-init.m4a
elemental-3703213907.m4v elemental-3703251445.m4a elemental-init.m4v
elemental-3703221415.m4a elemental-3703251445.m4v elemental-raw.m4a
elemental-3703221415.m4v elemental-3703258952.m4a elemental-raw.m4v
elemental-3703228922.m4a elemental-3703258952.m4v elemental.mpd
elemental.mpd is as following.
<?xml version="1.0"?>
<MPD
type="dynamic"
xmlns="urn:mpeg:dash:schema:mpd:2011"
availabilityStartTime="2017-04-27T11:22:32+08:00"
availabilityEndTime="2017-04-27T11:23:17+08:00"
minimumUpdatePeriod="PT5S"
minBufferTime="PT5S"
timeShiftBufferDepth="PT0H0M0.00S"
suggestedPresentationDelay="PT10S"
profiles="urn:hbbtv:dash:profile:isoff-live:2012,urn:mpeg:dash:profile:isoff
-live:2011"
xmlns:xsi="http://www.w3.org/2011/XMLSchema-instance"
xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
<Period start="PT0S" id="dash">
<AdaptationSet
id="1"
segmentAlignment="true"
maxWidth="1280"
maxHeight="720"
maxFrameRate="23">
<Representation
id="elemental_H264"
mimeType="video/mp4"
codecs="avc1.4d401f"
width="1280"
height="720"
frameRate="23"
sar="1:1"
startWithSAP="1"
bandwidth="5000000">
<SegmentTemplate
presentationTimeOffset="0"
timescale="1000"
media="elemental-$Time$.m4v"
initialization="elemental-init.m4v">
<SegmentTimeline>
<S t="3703228922" d="7508"/>
<S t="3703236430" d="7507"/>
<S t="3703243937" d="7508"/>
<S t="3703251445" d="7507"/>
<S t="3703258952" d="7508"/>
<S t="3703266460" d="7507"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
<AdaptationSet
id="2"
segmentAlignment="true">
<AudioChannelConfiguration
schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
value="1"/>
<Representation
id="elemental_AAC"
mimeType="audio/mp4"
codecs="mp4a.40.2"
audioSamplingRate="48000"
startWithSAP="1"
bandwidth="96000">
<SegmentTemplate
presentationTimeOffset="0"
timescale="1000"
media="elemental-$Time$.m4a"
initialization="elemental-init.m4a">
<SegmentTimeline>
<S t="3703228922" d="7508"/>
<S t="3703236430" d="7507"/>
<S t="3703243937" d="7508"/>
<S t="3703251445" d="7507"/>
<S t="3703258952" d="7508"/>
<S t="3703266460" d="7507"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
</Period>
</MPD>
Using dash.js, but playback doesn't work.
In developer console of Chrome browser, video.js repeat to read elemental.mpd.
What wrong is MPEG-DASH?

Related

LOG4Net: Cannot find Property [additivity] to set object on [log4net.Appender.RollingFileAppender]

Any help would be appreciated.
I am using GCP Kubernetes Engine.
Getting following error in POD:
log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [additivity] to set object on [log4net.Appender.RollingFileAppender]
Here is my configuration file:
apiVersion: v1
kind: ConfigMap
metadata:
name: log4net-config
namespace: bold-services
data:
Log4Net.config: |
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<log4net threshold="ALL" debug="true">
<root>
<level value="ALL" />
<!-- <appender-ref ref="ConsoleAppender" /> -->
<appender-ref ref="FILE_DEBUG_APPENDER" />
<appender-ref ref="FILE_ERROR_APPENDER" />
</root>
<!-- === File Appender for NON-ERROR messages file === -->
<appender name="FILE_DEBUG_APPENDER" type="log4net.Appender.RollingFileAppender" class="ch.qos.logback.classic.AsyncAppender">
<file type="log4net.Util.PatternString" value="%property{AppDataPath}/logs/%property{loggername}/debug-info-%env{HOSTNAME}.txt" />
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<additivity value="true" />
<appendToFile value="true" />
<maxSizeRollBackups value="1" />
<maximumFileSize value="300KB" />
<rollingStyle value="Size" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<header type="log4net.Util.PatternString" value="#Software: %property{loggername} %newline#Date: %date %newline#Fields: date thread namespace methodname message %newline" />
<conversionPattern value="%date [%thread] %message%newline" />
</layout>
</appender>
<!-- === File Appender for ERROR messages file === -->
<appender name="FILE_ERROR_APPENDER" type="log4net.Appender.RollingFileAppender" class="ch.qos.logback.classic.AsyncAppender">
<file type="log4net.Util.PatternString" value="%property{AppDataPath}/logs/%property{loggername}/errors-%env{HOSTNAME}.txt" />
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="ERROR" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<additivity value="true" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="100KB" />
<rollingStyle value="Size" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<header type="log4net.Util.PatternString" value="#Software: %property{loggername} %newline#Date: %date %newline#Fields: date thread namespace methodname message %newline" />
<conversionPattern value="%date [%thread] %-5level %message%newline" />
</layout>
</appender>
<!-- === Console Appender to use in BufferingForwardingAppender === -->
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern type="log4net.Util.PatternString" value="%newline%%-5level %property{loggername} %env{HOSTNAME} %%date [%%thread] %%message%newline" />
</layout>
</appender>
</log4net>
</configuration>

How to retrieve unconverted data from xml file

We have a script that does a backup of NTFS permissions to an .xml file:
Get-Acl -Path 'C:\myFolder' | Export-Clixml -Path $ntfsXmlFile
Then on another machine we try to restore these permissions on a specific folder. This would be easy by doing
Import-Clixml -LiteralPath $ntfsXmlFile | Set-Acl -Path 'C:\otherFolder'
However, in some cases it can be that not all accounts in the $ntfsXmlFile are available on the second machine. So we create the Access Control List manually and verify if each Access Control Entry exists before adding it to the ACL.
The problem is that unknown account names are converted to an unrecognizable string when using Import-Clixml:
BinaryLength AccountDomainSid Value
------------ ---------------- -----
28 S-1-5-21-497061539-31097515 S-1-5-21-497061539-31067-310415-1030
The xml file exported by Export-Clixml looks like this:
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<TN RefId="0">
<T>System.Security.AccessControl.DirectorySecurity</T>
<T>System.Security.AccessControl.FileSystemSecurity</T>
<T>System.Security.AccessControl.NativeObjectSecurity</T>
<T>System.Security.AccessControl.CommonObjectSecurity</T>
<T>System.Security.AccessControl.ObjectSecurity</T>
<T>System.Object</T>
</TN>
<ToString>System.Security.AccessControl.DirectorySecurity</ToString>
<Props>
<S N="AccessRightType">System.Security.AccessControl.FileSystemRights</S>
<S N="AccessRuleType">System.Security.AccessControl.FileSystemAccessRule</S>
<S N="AuditRuleType">System.Security.AccessControl.FileSystemAuditRule</S>
<B N="AreAccessRulesProtected">true</B>
<B N="AreAuditRulesProtected">false</B>
<B N="AreAccessRulesCanonical">true</B>
<B N="AreAuditRulesCanonical">true</B>
</Props>
<MS>
<S N="PSPath">Microsoft.PowerShell.Core\FileSystem::C:\myFolder</S>
<S N="PSParentPath">Microsoft.PowerShell.Core\FileSystem::C:\myFolder</S>
<S N="PSChildName">B</S>
<Obj N="PSDrive" RefId="1">
<TN RefId="1">
<T>System.Management.Automation.PSDriveInfo</T>
<T>System.Object</T>
</TN>
<ToString>C</ToString>
<Props>
<S N="CurrentLocation"></S>
<S N="Name">C</S>
<Obj N="Provider" RefId="2">
<S>Microsoft.PowerShell.Core\FileSystem</S>
</Obj>
<S N="Root">C:\</S>
<S N="Description">System</S>
<Nil N="MaximumSize" />
<Obj N="Credential" RefId="3">
<TN RefId="2">
<T>System.Management.Automation.PSCredential</T>
<T>System.Object</T>
</TN>
<ToString>System.Management.Automation.PSCredential</ToString>
<Props>
<Nil N="UserName" />
<Nil N="Password" />
</Props>
</Obj>
<Nil N="DisplayRoot" />
</Props>
<MS>
<U64 N="Used">70907654144</U64>
<U64 N="Free">14884746544</U64>
</MS>
</Obj>
<Obj N="PSProvider" RefId="4">
<TN RefId="3">
<T>System.Management.Automation.ProviderInfo</T>
<T>System.Object</T>
</TN>
<ToString>Microsoft.PowerShell.Core\FileSystem</ToString>
<Props>
<S N="ImplementingType">Microsoft.PowerShell.Commands.FileSystemProvider</S>
<S N="HelpFile">System.Management.Automation.dll-Help.xml</S>
<S N="Name">FileSystem</S>
<S N="PSSnapIn">Microsoft.PowerShell.Core</S>
<S N="ModuleName">Microsoft.PowerShell.Core</S>
<Nil N="Module" />
<S N="Description"></S>
<S N="Capabilities">Filter, ShouldProcess, Credentials</S>
<S N="Home">C:\Users\bob</S>
<Obj N="Drives" RefId="5">
<TN RefId="4">
<T>System.Collections.ObjectModel.Collection`1[[System.Management.Automation.PSDriveInfo, System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]</T>
<T>System.Object</T>
</TN>
<LST>
<S>A</S>
<Ref RefId="1" />
<S>D</S>
<Obj RefId="6">
<S>L</S>
</Obj>
<S>S</S>
<Obj RefId="7">
<S>T</S>
</Obj>
<S>TestDrive</S>
<S>Z</S>
</LST>
</Obj>
</Props>
</Obj>
<Nil N="CentralAccessPolicyId" />
<Nil N="CentralAccessPolicyName" />
<S N="Path">Microsoft.PowerShell.Core\FileSystem::C:\myFolder</S>
<S N="Owner">BUILTIN\Administrators</S>
<S N="Group">GROUPHC\Domain Users</S>
<Obj N="Access" RefId="8">
<TN RefId="5">
<T>System.Security.AccessControl.AuthorizationRuleCollection</T>
<T>System.Collections.ReadOnlyCollectionBase</T>
<T>System.Object</T>
</TN>
<IE>
<S>System.Security.AccessControl.FileSystemAccessRule</S>
<S>System.Security.AccessControl.FileSystemAccessRule</S>
<S>System.Security.AccessControl.FileSystemAccessRule</S>
</IE>
</Obj>
<S N="Sddl">O:BAG:DUD:PAI(A;OICI;FA;;;BA)(A;OICI;0x1301bf;;;S-1-5-21-497061539-3109733767-3104415515-1037)(A;OICI;0x1301bf;;;S-1-5-21-497061539-3109733767-3104415515-1038)</S>
<S N="AccessToString">BUILTIN\Administrators Allow FullControl_x000A_PC1\TestUser1 Allow Modify, Synchronize_x000A_PC1\TestUser2 Allow Modify, Synchronize</S>
<S N="AuditToString"></S>
</MS>
</Obj>
</Objs>
We're trying to access the property Access but the following fails:
$rawXml = [Xml] (Get-Content -LiteralPath $ntfsFile)
$rawXml.SelectNodes('Objs.Obj.MS.Obj.N.Access')
Ideally we would like to retrieve the following:
BUILTIN\Administrators Allow FullControl_x000A_
PC1\TestUser1 Allow Modify, Synchronize_x000A_
PC1\TestUser2 Allow Modify, Synchronize
Is there a way to get the correct account principal name out of the exported xml file?
Thanks to #Mathias in the comments the following code works to retrieve the Access list:
$rawXml = [Xml] (Get-Content -Path $ntfsFile)
($rawXml.Objs.Obj.MS.S | Where-Object N -EQ AccessToString |
ForEach-Object InnerText ) -split '_x000A_'

Android Constraint Layout result differs when using guideline

The result for a Constraint Layout differs when I use a Guideline in my Constraint Layout.
Guideline:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/constraintScroll"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideline_scroll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.2" />
<TextView
android:id="#+id/textView_1"
style="#style/Numbers"
android:text="1"
app:layout_constraintBottom_toBottomOf="#id/iB_scroll_00"
app:layout_constraintEnd_toStartOf="#id/iV_pins_0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#id/iB_scroll_00" />
<ImageView
android:id="#+id/iV_pins_0"
style="#style/Pins"
app:layout_constraintBottom_toBottomOf="#+id/iB_scroll_00"
app:layout_constraintEnd_toStartOf="#id/guideline_scroll"
app:layout_constraintStart_toEndOf="#+id/textView_1"
app:layout_constraintTop_toTopOf="#id/iB_scroll_00" />
<ImageButton
android:id="#+id/iB_scroll_00"
style="#style/Scroll"
android:layout_marginTop="8dp"
android:background="#null"
android:onClick="onClickScroll"
app:layout_constraintEnd_toStartOf="#id/iB_scroll_01"
app:layout_constraintStart_toEndOf="#id/guideline_scroll"
app:layout_constraintTop_toBottomOf="#id/iB_scroll_10" />
<ImageButton
android:id="#+id/iB_scroll_01"
style="#style/Scroll"
android:background="#null"
android:onClick="onClickScroll"
app:layout_constraintBottom_toBottomOf="#id/iB_scroll_00"
app:layout_constraintEnd_toStartOf="#id/iB_scroll_02"
app:layout_constraintStart_toEndOf="#id/iB_scroll_00"
app:layout_constraintTop_toTopOf="#id/iB_scroll_00" />
<ImageButton
android:id="#+id/iB_scroll_02"
style="#style/Scroll"
android:background="#null"
android:onClick="onClickScroll"
app:layout_constraintBottom_toBottomOf="#id/iB_scroll_00"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#id/iB_scroll_01"
app:layout_constraintTop_toTopOf="#id/iB_scroll_00" />
<TextView
android:id="#+id/textView_2"
style="#style/Numbers"
android:text="2"
app:layout_constraintBottom_toTopOf="#+id/textView_1"
app:layout_constraintEnd_toStartOf="#id/iV_pins_1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/iV_pins_1"
style="#style/Pins"
app:layout_constraintBottom_toBottomOf="#+id/iB_scroll_10"
app:layout_constraintEnd_toStartOf="#id/guideline_scroll"
app:layout_constraintStart_toEndOf="#+id/textView_2"
app:layout_constraintTop_toTopOf="#id/iB_scroll_10" />
<ImageButton
android:id="#+id/iB_scroll_10"
style="#style/Scroll"
android:background="#null"
android:clickable="false"
android:onClick="onClickScroll"
app:layout_constraintBottom_toTopOf="#id/iB_scroll_00"
app:layout_constraintEnd_toStartOf="#id/iB_scroll_11"
app:layout_constraintStart_toEndOf="#id/guideline_scroll"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="#+id/iB_scroll_11"
style="#style/Scroll"
android:background="#null"
android:clickable="false"
android:onClick="onClickScroll"
app:layout_constraintBottom_toBottomOf="#id/iB_scroll_10"
app:layout_constraintEnd_toStartOf="#id/iB_scroll_12"
app:layout_constraintStart_toEndOf="#id/iB_scroll_10"
app:layout_constraintTop_toTopOf="#id/iB_scroll_10" />
<ImageButton
android:id="#+id/iB_scroll_12"
style="#style/Scroll"
android:background="#null"
android:clickable="false"
android:onClick="onClickScroll"
app:layout_constraintBottom_toBottomOf="#id/iB_scroll_10"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#id/iB_scroll_11"
app:layout_constraintTop_toTopOf="#id/iB_scroll_10" />
</androidx.constraintlayout.widget.ConstraintLayout>
Guideline
No Guideline:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/constraintScroll"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/textView_1"
style="#style/Numbers"
android:text="1"
app:layout_constraintBottom_toBottomOf="#id/iB_scroll_00"
app:layout_constraintEnd_toStartOf="#id/iV_pins_0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#id/iB_scroll_00" />
<ImageView
android:id="#+id/iV_pins_0"
style="#style/Pins"
app:layout_constraintBottom_toBottomOf="#+id/iB_scroll_00"
app:layout_constraintEnd_toStartOf="#id/iB_scroll_00"
app:layout_constraintStart_toEndOf="#+id/textView_1"
app:layout_constraintTop_toTopOf="#id/iB_scroll_00" />
<ImageButton
android:id="#+id/iB_scroll_00"
style="#style/Scroll"
android:layout_marginTop="8dp"
android:background="#null"
android:onClick="onClickScroll"
app:layout_constraintEnd_toStartOf="#id/iB_scroll_01"
app:layout_constraintStart_toEndOf="#id/iV_pins_0"
app:layout_constraintTop_toBottomOf="#id/iB_scroll_10" />
<ImageButton
android:id="#+id/iB_scroll_01"
style="#style/Scroll"
android:background="#null"
android:onClick="onClickScroll"
app:layout_constraintBottom_toBottomOf="#id/iB_scroll_00"
app:layout_constraintEnd_toStartOf="#id/iB_scroll_02"
app:layout_constraintStart_toEndOf="#id/iB_scroll_00"
app:layout_constraintTop_toTopOf="#id/iB_scroll_00" />
<ImageButton
android:id="#+id/iB_scroll_02"
style="#style/Scroll"
android:background="#null"
android:onClick="onClickScroll"
app:layout_constraintBottom_toBottomOf="#id/iB_scroll_00"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#id/iB_scroll_01"
app:layout_constraintTop_toTopOf="#id/iB_scroll_00" />
<TextView
android:id="#+id/textView_2"
style="#style/Numbers"
android:text="2"
app:layout_constraintBottom_toTopOf="#+id/textView_1"
app:layout_constraintEnd_toStartOf="#id/iV_pins_1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/iV_pins_1"
style="#style/Pins"
app:layout_constraintBottom_toBottomOf="#+id/iB_scroll_10"
app:layout_constraintEnd_toStartOf="#id/iB_scroll_10"
app:layout_constraintStart_toEndOf="#+id/textView_2"
app:layout_constraintTop_toTopOf="#id/iB_scroll_10" />
<ImageButton
android:id="#+id/iB_scroll_10"
style="#style/Scroll"
android:background="#null"
android:clickable="false"
android:onClick="onClickScroll"
app:layout_constraintBottom_toTopOf="#id/iB_scroll_00"
app:layout_constraintEnd_toStartOf="#id/iB_scroll_11"
app:layout_constraintStart_toEndOf="#id/iV_pins_1"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="#+id/iB_scroll_11"
style="#style/Scroll"
android:background="#null"
android:clickable="false"
android:onClick="onClickScroll"
app:layout_constraintBottom_toBottomOf="#id/iB_scroll_10"
app:layout_constraintEnd_toStartOf="#id/iB_scroll_12"
app:layout_constraintStart_toEndOf="#id/iB_scroll_10"
app:layout_constraintTop_toTopOf="#id/iB_scroll_10" />
<ImageButton
android:id="#+id/iB_scroll_12"
style="#style/Scroll"
android:background="#null"
android:clickable="false"
android:onClick="onClickScroll"
app:layout_constraintBottom_toBottomOf="#id/iB_scroll_10"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#id/iB_scroll_11"
app:layout_constraintTop_toTopOf="#id/iB_scroll_10" />
</androidx.constraintlayout.widget.ConstraintLayout>
No Guideline
Styles.xml:
<resources>
<style name="Scroll" parent="#style/Widget.AppCompat.ImageButton">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">0dp</item>
<item name="android:adjustViewBounds">true</item>
<item name="android:scaleType">fitCenter</item>
<item name="layout_constraintDimensionRatio">1</item>
<item name="layout_constraintHorizontal_weight">1.5</item>
<item name="layout_constraintWidth_max">90dp</item>
<item name="android:layout_marginStart">4dp</item>
<item name="srcCompat">#drawable/ic_empty</item>
</style>
<style name="Pins">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">0dp</item>
<item name="android:adjustViewBounds">true</item>
<item name="android:scaleType">fitCenter</item>
<item name="layout_constraintDimensionRatio">1</item>
<item name="layout_constraintHorizontal_weight">1.2</item>
<item name="layout_constraintWidth_max">60dp</item>
<item name="srcCompat">#drawable/pins_6</item>
<item name="android:layout_marginStart">4dp</item>
</style>
<style name="Numbers">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">0dp</item>
<item name="autoSizeMaxTextSize">60sp</item>
<item name="autoSizeMinTextSize">8sp</item>
<item name="autoSizeStepGranularity">1sp</item>
<item name="autoSizeTextType">uniform</item>
<item name="layout_constraintHorizontal_weight">0.7</item>
<item name="android:gravity">center</item>
</style>
</resources>
The Image Buttons should be so big as they are when I use no guideline. But I need a guideline, because I have another layout where I want that the views start at the same position and so are vertically aligned to the Image Buttons here (fixed header of ScrollLayout). I tried to achieve this via a guideline, but the result for the Constraint Layout above is not as expected...
I solved it by removing the Constraint Dimension Ratio for style „pins“. I am not totally sure why this helps in the guideline case, but it solved it.

GWT remote logging going to System.out instead of log file

I have setup gwt remote logging based on the gwt documentation, however my logs are going to System.out instead of being written to a log file.
My gwt module looks like:
<module rename-to='ezdappserver'>
<inherits name="com.google.gwt.logging.Logging"/>
<set-property name="gwt.logging.simpleRemoteHandler" value="ENABLED" />
<set-property name="gwt.logging.logLevel" value="FINEST"/>
<set-property name="gwt.logging.enabled" value="TRUE"/>
<set-property name="gwt.logging.consoleHandler" value="ENABLED" />
<set-property name="gwt.logging.popupHandler" value="DISABLED" />
</module>
My servlet definition is setup like:
<servlet>
<servlet-name>remoteLogging</servlet-name>
<servlet-class>com.google.gwt.logging.server.RemoteLoggingServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>remoteLogging</servlet-name>
<url-pattern>/ezdappserver/remote_logging</url-pattern>
</servlet-mapping>
When an error is logged I see output in my console like so:
Mar 26, 2014 2:10:36 PM com.google.gwt.logging.server.RemoteLoggingServiceUtil logOnServer
SEVERE: Exception caught: (NotFoundError)
....Rest of error....
I was expecting this output to be written to a log file somewhere in my war. Also, I would really like to be able to specify where this file is located, however I haven't been able to find any documentation on that either.
Any help would be much appreciated.
NOTE: I am not running this through dev mode, this is with compiled code.
Thanks!
Try below options also in gwt.xml based on your requirement:
<!-- This handler sends log messages to the server, where they will be logged using the server side logging mechanism. -->
<set-property name="gwt.logging.simpleRemoteHandler" value="ENABLED" />
<!-- Logs by calling method GWT.log. These messages can only be seen in Development Mode in the DevMode window. -->
<set-property name="gwt.logging.developmentModeHandler" value="ENABLED" />
<!-- These messages can only be seen in Development Mode in the DevMode window. -->
<set-property name="gwt.logging.systemHandler" value="ENABLED" />
<!-- Logs to the popup which resides in the upper left hand corner of application when this handler is enabled. -->
<set-property name="gwt.logging.popupHandler" value="DISABLED" />
<!-- Logs to the javascript console, which is used by Firebug Lite (for IE), Safari and Chrome. -->
<set-property name="gwt.logging.consoleHandler" value="DISABLED"/>
<!-- Logs to the firebug console. -->
<set-property name="gwt.logging.firebugHandler" value="DISABLED" />
If above configuration are still not working for you then try below code along with above configuration.
Add log4j.xml file to define the log file location with log level
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="DT=> %d [%.4t] %-5p %c{1} - %m%n" />
</layout>
</appender>
<appender name="SERVER_FILE_LOG" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="${jboss.server.log.dir}/logs/DataTools_Server.log" />
<param name="Append" value="true" />
<param name="MaxFileSize" value="5MB" />
<param name="MaxBackupIndex" value="10" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%.4t] %-5p [%c] %m%n" />
</layout>
</appender>
<appender name="CLIENT_FILE_LOG" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="${jboss.server.log.dir}/logs/DataTools_Client.log" />
<param name="Append" value="true" />
<param name="MaxFileSize" value="5MB" />
<param name="MaxBackupIndex" value="10" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%.4t] %-5p %m%n" />
</layout>
</appender>
<category name="com.x.y.server">
<priority value="DEBUG" />
<appender-ref ref="SERVER_FILE_LOG" />
<appender-ref ref="STDOUT" />
</category>
<category name="gwtRemoteLogging">
<priority value="ERROR" />
<appender-ref ref="CLIENT_FILE_LOG" />
</category>
<root>
<priority value ="ERROR" />
<appender-ref ref="SERVER_FILE_LOG" />
</root>
</log4j:configuration>
Define you own logging servlet by implementing RemoteLoggingService
import java.util.logging.Level;
import java.util.logging.LogRecord;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import com.google.gwt.logging.server.StackTraceDeobfuscator;
import com.google.gwt.logging.shared.RemoteLoggingService;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import org.apache.log4j.Logger;
/**
* The Class GwtRemoteLogging.
*/
#SuppressWarnings("serial")
public class GwtRemoteLogging extends RemoteServiceServlet implements RemoteLoggingService {
/** The Constant logger. */
private StackTraceDeobfuscator deobfuscator = null;
private final static Logger logger = Logger.getLogger("gwtRemoteLogging");
#Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
/**
* Logs a Log Record which has been serialized using GWT RPC on the server.
*
* #return either an error message, or null if logging is successful.
*/
public final String logOnServer(LogRecord lr) {
try {
if (lr.getLevel().equals(Level.SEVERE)) {
logger.error(lr.getMessage(),lr.getThrown());
} else if (lr.getLevel().equals(Level.INFO)) {
logger.info(lr.getMessage(),lr.getThrown());
} else if (lr.getLevel().equals(Level.WARNING)) {
logger.warn(lr.getMessage(),lr.getThrown());
} else if (lr.getLevel().equals(Level.FINE)) {
logger.debug(lr.getMessage(),lr.getThrown());
} else {
logger.trace(lr.getMessage(),lr.getThrown());
}
} catch (Exception e) {
logger.error("Remote logging failed", e);
return "Remote logging failed, check stack trace for details.";
}
return null;
}
/**
* By default, this service does not do any deobfuscation. In order to do server side
* deobfuscation, you must copy the symbolMaps files to a directory visible to the server and
* set the directory using this method.
*
* #param symbolMapsDir
*/
public void setSymbolMapsDirectory(String symbolMapsDir) {
if (deobfuscator == null) {
deobfuscator = new StackTraceDeobfuscator(symbolMapsDir);
} else {
deobfuscator.setSymbolMapsDirectory(symbolMapsDir);
}
}
}
web.xml
<servlet>
<servlet-name>remoteLogServlet</servlet-name>
<servlet-class>com.x.y.server.servlet.GwtRemoteLogging</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>remoteLogServlet</servlet-name>
<url-pattern>/ezdappserver/remote_logging</url-pattern>
</servlet-mapping>
The RemoteServiceServlet uses java.util.logging to log, and by default it logs to the console (System.err, not System.out BTW).
If you want to log to a file, then you have to configure java.util.logging; either editing your global lib/logging.properties (not recommended), using your own config file that you pass to the JVM using the java.util.logging.config.file system property, or programmatically.
Depending on your servlet container, it can be configured by different means. For instance, Tomcat will read a logging.properties file in your WEB-INF/classes: http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Using_java.util.logging_(default)

Need help in updating (windows unattend.xml) xml file with powershell

Here's my XML file: I would prefer to read the xml and then modify the computername to say newcompname and write it back to file
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<servicing>
</servicing>
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>testserver007</ComputerName>
<RegisteredOrganization>MyOrganization</RegisteredOrganization>
<RegisteredOwner>Admin</RegisteredOwner>
<ShowWindowsLive>false</ShowWindowsLive>
</component>
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<fDenyTSConnections>false</fDenyTSConnections>
</component>
<component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UserAuthentication>1</UserAuthentication>
</component>
<component name="Microsoft-Windows-TCPIP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Interfaces>
<Interface wcm:action="add">
<Ipv4Settings>
<DhcpEnabled>false</DhcpEnabled>
<RouterDiscoveryEnabled>false</RouterDiscoveryEnabled>
<Metric>10</Metric>
</Ipv4Settings>
<Identifier>Local Area Connection</Identifier>
<Routes>
<Route wcm:action="add">
<Identifier>1</Identifier>
<Metric>10</Metric>
<NextHopAddress>192.168.2.247</NextHopAddress>
<Prefix>0.0.0.0/0</Prefix>
</Route>
</Routes>
<UnicastIpAddresses>
<IpAddress wcm:action="add" wcm:keyValue="1">192.168.2.101/24</IpAddress>
</UnicastIpAddresses>
</Interface>
</Interfaces>
</component>
<component name="Microsoft-Windows-DNS-Client" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Interfaces>
<Interface wcm:action="add">
<DNSServerSearchOrder>
<IpAddress wcm:action="add" wcm:keyValue="1">192.168.2.75</IpAddress>
<IpAddress wcm:action="add" wcm:keyValue="2">192.168.2.76</IpAddress>
</DNSServerSearchOrder>
<Identifier>Local Area Connection</Identifier>
<EnableAdapterDomainNameRegistration>true</EnableAdapterDomainNameRegistration>
<DisableDynamicUpdate>false</DisableDynamicUpdate>
</Interface>
</Interfaces>
</component>
<component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
</component>
<component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>0809:00000809</InputLocale>
<SystemLocale>en-GB</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>en-GB</UserLocale>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AutoLogon>
<Password>
<Value>RgBvAG4ANgBIADAAbQBlAFAAYQBzAHMAdwBvAHIAZAA=</Value>
<PlainText>false</PlainText>
</Password>
<Domain>testserver007</Domain>
<Enabled>true</Enabled>
<LogonCount>5</LogonCount>
<Username>Administrator</Username>
</AutoLogon>
<FirstLogonCommands>
<SynchronousCommand>
<Order>1</Order>
<!-- Post Build Script 1 -->
<CommandLine>cmd.exe /C C:\BuildScripts\firsttest.cmd</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
<Display>
<ColorDepth>32</ColorDepth>
<HorizontalResolution>1024</HorizontalResolution>
<VerticalResolution>768</VerticalResolution>
</Display>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<ProtectYourPC>3</ProtectYourPC>
<NetworkLocation>Other</NetworkLocation>
</OOBE>
<UserAccounts>
<AdministratorPassword>
<Value>RgBvAG4ANgBIADAAbQBlAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA==</Value>
<PlainText>false</PlainText>
</AdministratorPassword>
</UserAccounts>
<RegisteredOrganization>MyOrganization</RegisteredOrganization>
<RegisteredOwner>Admin</RegisteredOwner>
<TimeZone>GMT Standard Time</TimeZone>
<LogonCommands>
<AsynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /C C:\Scripts\test.cmd</CommandLine>
<Description>test command</Description>
<Order>2</Order>
<RequiresUserInput>true</RequiresUserInput>
</AsynchronousCommand>
</LogonCommands>
</component>
</settings>
<cpi:offlineImage cpi:source="catalog:d:/win2008r2instfiles/sources/install_windows server 2008 r2 serverstandard.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
you can use a variety of techniques whether iterating through the nodes like the following example, calling select-xml with an XPATH query to find the node and then change the value, or $xml.selectNodes(...). Normally i'd go the xpath route, but with the namespace included and it being simple XML this was the easiest way to demonstrate it in PowerShell
$xml = [xml]#"
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">#
<servicing></servicing>
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>testserver007</ComputerName>
<RegisteredOrganization>MyOrg</RegisteredOrganization>
<RegisteredOwner>Admin</RegisteredOwner>
<ShowWindowsLive>false</ShowWindowsLive>
</component>
</settings>
</unattend>
"#
#presuming multiple settings tags, with multiplecomponents
$xml.unattend | foreach { $_.settings } | foreach { $_.component.computername = "newname" }
$xml.save("c:\temp\test.xml")